return *probe.Error for Untrace() as well.

This commit is contained in:
Anand Babu (AB) Periasamy 2015-08-24 03:35:24 -07:00
parent 526c8b4d76
commit c11aa1c892

View File

@ -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.