File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ type StackTraceConfiguration struct {
76
76
// if the stack frame's package matches one of these prefixes
77
77
// sentry will identify the stack frame as "in_app"
78
78
InAppPrefixes []string
79
+ // whether sending exception type should be enabled.
80
+ SendExceptionType bool
79
81
}
80
82
81
83
// NewSentryHook creates a hook to be added to an instance of logger
@@ -106,11 +108,12 @@ func NewWithClientSentryHook(client *raven.Client, levels []logrus.Level) (*Sent
106
108
return & SentryHook {
107
109
Timeout : 100 * time .Millisecond ,
108
110
StacktraceConfiguration : StackTraceConfiguration {
109
- Enable : false ,
110
- Level : logrus .ErrorLevel ,
111
- Skip : 5 ,
112
- Context : 0 ,
113
- InAppPrefixes : nil ,
111
+ Enable : false ,
112
+ Level : logrus .ErrorLevel ,
113
+ Skip : 5 ,
114
+ Context : 0 ,
115
+ InAppPrefixes : nil ,
116
+ SendExceptionType : true ,
114
117
},
115
118
client : client ,
116
119
levels : levels ,
@@ -196,6 +199,9 @@ func (hook *SentryHook) Fire(entry *logrus.Entry) error {
196
199
}
197
200
err := errors .Cause (err )
198
201
exc := raven .NewException (err , currentStacktrace )
202
+ if ! stConfig .SendExceptionType {
203
+ exc .Type = ""
204
+ }
199
205
packet .Interfaces = append (packet .Interfaces , exc )
200
206
packet .Culprit = err .Error ()
201
207
} else {
You can’t perform that action at this time.
0 commit comments