@@ -44,7 +44,7 @@ public App()
4444 }
4545 catch ( Exception e )
4646 {
47- ShowErrorMsgBox ( "Cannot load setting storage, please check local data directory" , e ) ;
47+ ShowErrorMsgBoxAndFailFast ( "Cannot load setting storage, please check local data directory" , e ) ;
4848 return ;
4949 }
5050
@@ -69,7 +69,7 @@ public App()
6969 }
7070 catch ( Exception e )
7171 {
72- ShowErrorMsgBox ( "Cannot configure dependency injection container, please open new issue in Flow.Launcher" , e ) ;
72+ ShowErrorMsgBoxAndFailFast ( "Cannot configure dependency injection container, please open new issue in Flow.Launcher" , e ) ;
7373 return ;
7474 }
7575
@@ -81,14 +81,18 @@ public App()
8181 }
8282 catch ( Exception e )
8383 {
84- ShowErrorMsgBox ( "Cannot initialize api and settings, please open new issue in Flow.Launcher" , e ) ;
84+ ShowErrorMsgBoxAndFailFast ( "Cannot initialize api and settings, please open new issue in Flow.Launcher" , e ) ;
8585 return ;
8686 }
8787 }
8888
89- private static void ShowErrorMsgBox ( string caption , Exception e )
89+ private static void ShowErrorMsgBoxAndFailFast ( string message , Exception e )
9090 {
91- MessageBox . Show ( e . ToString ( ) , caption , MessageBoxButton . OK , MessageBoxImage . Error ) ;
91+ // Firstly show users the message
92+ MessageBox . Show ( e . ToString ( ) , message , MessageBoxButton . OK , MessageBoxImage . Error ) ;
93+
94+ // Flow cannot construct its App instance, so ensure Flow crashes w/ the exception info.
95+ Environment . FailFast ( message , e ) ;
9296 }
9397
9498 [ STAThread ]
0 commit comments