Skip to content

Commit

Permalink
When errors.Cause returns nil, use the original error value instead (#61
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tanel authored and evalphobia committed May 25, 2018
1 parent 57846a8 commit b78b274
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,11 @@ func (hook *SentryHook) Fire(entry *logrus.Entry) error {
if currentStacktrace == nil {
currentStacktrace = raven.NewStacktrace(stConfig.Skip, stConfig.Context, stConfig.InAppPrefixes)
}
exc := raven.NewException(errors.Cause(err), currentStacktrace)
cause := errors.Cause(err)
if cause == nil {
cause = err
}
exc := raven.NewException(cause, currentStacktrace)
if !stConfig.SendExceptionType {
exc.Type = ""
}
Expand Down

0 comments on commit b78b274

Please sign in to comment.