@@ -5,7 +5,6 @@ use crate::consts::APP_LOCK_FILE_NAME;
55use crate :: event:: CreateAppEventSchedulerEventLoopExt ;
66use clap:: Parser ;
77use std:: io:: Write ;
8- use std:: process:: exit;
98use tracing_subscriber:: EnvFilter ;
109use winit:: event_loop:: EventLoop ;
1110
@@ -46,8 +45,7 @@ pub fn start() {
4645 . truncate ( true )
4746 . open ( dirs:: app_data_dir ( ) . join ( APP_LOCK_FILE_NAME ) )
4847 else {
49- tracing:: error!( "Failed to open lock file, Exiting." ) ;
50- exit ( 1 ) ;
48+ panic ! ( "Failed to open lock file." )
5149 } ;
5250 let mut lock = fd_lock:: RwLock :: new ( lock_file) ;
5351 let lock = match lock. try_write ( ) {
@@ -60,7 +58,7 @@ pub fn start() {
6058 }
6159 Err ( _) => {
6260 tracing:: error!( "Another instance is already running, Exiting." ) ;
63- exit ( 1 ) ;
61+ std :: process :: exit ( 1 ) ;
6462 }
6563 } ;
6664
@@ -87,20 +85,16 @@ pub fn start() {
8785 context
8886 }
8987 Err ( cef:: InitError :: AlreadyRunning ) => {
90- tracing:: error!( "Another instance is already running, Exiting." ) ;
91- exit ( 1 ) ;
88+ panic ! ( "Another instance is already running." ) ;
9289 }
9390 Err ( cef:: InitError :: InitializationFailed ( code) ) => {
94- tracing:: error!( "Cef initialization failed with code: {code}" ) ;
95- exit ( 1 ) ;
91+ panic ! ( "Cef initialization failed with code: {code}" ) ;
9692 }
9793 Err ( cef:: InitError :: BrowserCreationFailed ) => {
98- tracing:: error!( "Failed to create CEF browser" ) ;
99- exit ( 1 ) ;
94+ panic ! ( "Failed to create CEF browser" ) ;
10095 }
10196 Err ( cef:: InitError :: RequestContextCreationFailed ) => {
102- tracing:: error!( "Failed to create CEF request context" ) ;
103- exit ( 1 ) ;
97+ panic ! ( "Failed to create CEF request context" ) ;
10498 }
10599 } ;
106100
@@ -139,7 +133,7 @@ pub fn start() {
139133 // Calling `exit` bypasses rust teardown and lets Windows perform process cleanup.
140134 // TODO: Identify and fix the underlying CEF shutdown issue so this workaround can be removed.
141135 #[ cfg( target_os = "windows" ) ]
142- exit ( 0 ) ;
136+ std :: process :: exit ( 0 ) ;
143137}
144138
145139pub fn start_helper ( ) {
0 commit comments