From c11aa1c8924dfae85847002dea081efb62ea23b4 Mon Sep 17 00:00:00 2001 From: "Anand Babu (AB) Periasamy" Date: Mon, 24 Aug 2015 03:35:24 -0700 Subject: [PATCH] return *probe.Error for Untrace() as well. --- pkg/probe/probe.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/probe/probe.go b/pkg/probe/probe.go index a7872a8a0..5a30c3196 100644 --- a/pkg/probe/probe.go +++ b/pkg/probe/probe.go @@ -108,18 +108,19 @@ func (e *Error) trace(fields ...string) *Error { } // Untrace erases last trace entry. -func (e *Error) Untrace() { +func (e *Error) Untrace() *Error { if e == nil { - return + return nil } e.lock.Lock() defer e.lock.Unlock() l := len(e.CallTrace) if l == 0 { - return + return nil } e.CallTrace = e.CallTrace[:l-1] + return e } // ToGoError returns original error message.