File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
libdd-crashtracker/src/collector Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ pub fn report_unhandled_exception(
1010 error_message : Option < & str > ,
1111 stack : StackTrace ,
1212) -> anyhow:: Result < ( ) > {
13- // if metadata or config is not set, then just return gracefully
14- let metadata = crash_handler:: get_metadata ( )
15- . ok_or_else ( || anyhow:: anyhow!( "Crash tracker not initialized: no metadata available" ) ) ?;
16- let config = crash_handler:: get_config ( )
17- . ok_or_else ( || anyhow:: anyhow!( "Crash tracker not initialized: no config available" ) ) ?;
13+ // If crash tracker has not been initialized, return
14+ let Some ( metadata) = crash_handler:: get_metadata ( ) else {
15+ return Ok ( ( ) ) ;
16+ } ;
17+ let Some ( config) = crash_handler:: get_config ( ) else {
18+ return Ok ( ( ) ) ;
19+ } ;
1820
1921 let mut builder = CrashInfoBuilder :: new ( ) ;
2022 builder. with_kind ( ErrorKind :: UnhandledException ) ?;
You can’t perform that action at this time.
0 commit comments