Skip to content

Commit

Permalink
Allow switching the exception type and message (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteF authored and evalphobia committed Feb 19, 2018
1 parent 95dff72 commit 61ba158
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ type StackTraceConfiguration struct {
InAppPrefixes []string
// whether sending exception type should be enabled.
SendExceptionType bool
// whether the exception type and message should be switched.
SwitchExceptionTypeAndMessage bool
}

// NewSentryHook creates a hook to be added to an instance of logger
Expand Down Expand Up @@ -205,6 +207,9 @@ func (hook *SentryHook) Fire(entry *logrus.Entry) error {
if !stConfig.SendExceptionType {
exc.Type = ""
}
if stConfig.SwitchExceptionTypeAndMessage {
exc.Type, exc.Value = exc.Value, exc.Type
}
packet.Interfaces = append(packet.Interfaces, exc)
packet.Culprit = err.Error()
} else {
Expand Down

0 comments on commit 61ba158

Please sign in to comment.