File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -67,16 +67,17 @@ pub fn base_info_func(
6767 for_crash_report : bool ,
6868 extended_info_func : Option < fn ( & InfoContext , bool ) > ,
6969) {
70- if !for_crash_report {
71- if let Some ( func) = extended_info_func {
72- func ( ctx, for_crash_report) ;
73- return ;
70+ // If needed, add rust trace into the crash report (before module info)
71+ if for_crash_report {
72+ if ctx. add_info_section ( Some ( "trace" ) ) == Status :: Ok {
73+ let current_backtrace = Backtrace :: new ( ) ;
74+ let trace = format ! ( "{:?}" , current_backtrace) ;
75+ ctx. add_info_field_str ( "trace" , & trace) ;
7476 }
7577 }
76- // add rust trace into the crash report
77- if ctx. add_info_section ( Some ( "trace" ) ) == Status :: Ok {
78- let current_backtrace = Backtrace :: new ( ) ;
79- let trace = format ! ( "{:?}" , current_backtrace) ;
80- ctx. add_info_field_str ( "trace" , & trace) ;
78+
79+ if let Some ( func) = extended_info_func {
80+ // Add module info
81+ func ( ctx, for_crash_report) ;
8182 }
8283}
You can’t perform that action at this time.
0 commit comments