File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -162,22 +162,25 @@ pub fn report_error_sync(err: &mut anyhow::Error) {
162
162
return ;
163
163
}
164
164
165
- if sentry_client. is_enabled ( ) {
166
- tracing:: error!( "Reporting above error to sentry." ) ;
167
- } else {
165
+ if !sentry_client. is_enabled ( ) {
168
166
tracing:: error!( "Not reporting above error: SENTRY_DSN not set." ) ;
167
+ return ;
169
168
}
170
169
171
- sentry:: with_scope (
170
+ let event_id = sentry:: with_scope (
172
171
|scope| {
173
172
scope. set_level ( Some ( level) ) ;
174
173
scope. set_tag ( "short_msg" , err. short_msg ( ) ) ;
175
174
} ,
176
175
|| {
177
176
#[ allow( clippy:: disallowed_methods) ]
178
- sentry:: integrations:: anyhow:: capture_anyhow ( err) ;
177
+ sentry:: integrations:: anyhow:: capture_anyhow ( err)
179
178
} ,
180
179
) ;
180
+ tracing:: error!(
181
+ "Reporting above error to sentry with event_id {}" ,
182
+ event_id. simple( )
183
+ ) ;
181
184
} else {
182
185
tracing:: error!( "Not reporting above error to sentry." ) ;
183
186
}
You can’t perform that action at this time.
0 commit comments