cause gets used for the Stacktrace generation. However, Cause is called on the result of errors.WithStack, which simply removes that layer, so we don't have a trace anymore.
Is there a reason why Cause is used here? Maybe instead of always taking the Cause, check if the current err has a Stacktrace and cause has not, and use the stack of err?
Right now, if your error is the following:
it will not use that stacktrace. The reason is in
client.go
:https://github.com/getsentry/raven-go/blob/3033899c76deb3fb6570d9c4074d00443aeab88f/client.go#L710-L712
cause
gets used for the Stacktrace generation. However,Cause
is called on the result oferrors.WithStack
, which simply removes that layer, so we don't have a trace anymore.Is there a reason why
Cause
is used here? Maybe instead of always taking theCause
, check if the currenterr
has a Stacktrace andcause
has not, and use the stack oferr
?