Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Commit 69575a0

Browse files
martinxsliumattrobenolt
authored andcommitted
Use cause in place of err in GetOrNewStacktrace
1 parent d3909e6 commit 69575a0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

client.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ func newTransport() Transport {
318318
} else {
319319
t.Client = &http.Client{
320320
Transport: &http.Transport{
321-
Proxy: http.ProxyFromEnvironment,
321+
Proxy: http.ProxyFromEnvironment,
322322
TLSClientConfig: &tls.Config{RootCAs: rootCAs},
323323
},
324324
}
@@ -642,7 +642,7 @@ func (client *Client) CaptureError(err error, tags map[string]string, interfaces
642642

643643
cause := pkgErrors.Cause(err)
644644

645-
packet := NewPacket(cause.Error(), append(append(interfaces, client.context.interfaces()...), NewException(cause, GetOrNewStacktrace(err, 1, 3, client.includePaths)))...)
645+
packet := NewPacket(cause.Error(), append(append(interfaces, client.context.interfaces()...), NewException(cause, GetOrNewStacktrace(cause, 1, 3, client.includePaths)))...)
646646
eventID, _ := client.Capture(packet, tags)
647647

648648
return eventID
@@ -664,7 +664,9 @@ func (client *Client) CaptureErrorAndWait(err error, tags map[string]string, int
664664
return ""
665665
}
666666

667-
packet := NewPacket(err.Error(), append(append(interfaces, client.context.interfaces()...), NewException(err, NewStacktrace(1, 3, client.includePaths)))...)
667+
cause := pkgErrors.Cause(err)
668+
669+
packet := NewPacket(cause.Error(), append(append(interfaces, client.context.interfaces()...), NewException(cause, GetOrNewStacktrace(cause, 1, 3, client.includePaths)))...)
668670
eventID, ch := client.Capture(packet, tags)
669671
<-ch
670672

0 commit comments

Comments
 (0)