File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,15 +176,14 @@ action.on(CodeZeroEvent.error, (error: Error) => {
176176 console . error ( "Stream error:" , error . message ) ;
177177 console . log ( "Attempting to reconnect in 5s..." ) ;
178178 setTimeout ( ( ) => {
179- action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : unknown ) => {
180- console . error ( "Reconnect failed:" , err ) ;
181- } ) ;
179+ action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : Error ) => {
180+ action . emit ( CodeZeroEvent . error , err ) ;
181+ } )
182182 } , 5000 ) ;
183183} ) ;
184184
185- action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : unknown ) => {
186- console . error ( "Failed to connect:" , err ) ;
187- process . exit ( 1 ) ;
185+ action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : Error ) => {
186+ action . emit ( CodeZeroEvent . error , err ) ;
188187} ) ;
189188
190189action . on ( CodeZeroEvent . moduleUpdated , ( message : any ) => {
Original file line number Diff line number Diff line change @@ -52,15 +52,14 @@ action.on(CodeZeroEvent.error, (error: Error) => {
5252 console . error ( "Stream error:" , error . message ) ;
5353 console . log ( "Attempting to reconnect in 5s..." ) ;
5454 setTimeout ( ( ) => {
55- action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : unknown ) => {
56- console . error ( "Reconnect failed:" , err ) ;
57- } ) ;
55+ action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : Error ) => {
56+ action . emit ( CodeZeroEvent . error , err ) ;
57+ } )
5858 } , 5000 ) ;
5959} ) ;
6060
61- action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : unknown ) => {
62- console . error ( "Failed to connect:" , err ) ;
63- process . exit ( 1 ) ;
61+ action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : Error ) => {
62+ action . emit ( CodeZeroEvent . error , err ) ;
6463} ) ;
6564
6665action . on ( CodeZeroEvent . moduleUpdated , ( message : any ) => {
Original file line number Diff line number Diff line change @@ -32,15 +32,14 @@ action.on(CodeZeroEvent.error, (error: Error) => {
3232 console . error ( "Stream error:" , error . message ) ;
3333 console . log ( "Attempting to reconnect in 5s..." ) ;
3434 setTimeout ( ( ) => {
35- action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : unknown ) => {
36- console . error ( "Reconnect failed:" , err ) ;
37- } ) ;
35+ action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : Error ) => {
36+ action . emit ( CodeZeroEvent . error , err ) ;
37+ } )
3838 } , 5000 ) ;
3939} ) ;
4040
41- action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : unknown ) => {
42- console . error ( "Failed to connect:" , err ) ;
43- process . exit ( 1 ) ;
41+ action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : Error ) => {
42+ action . emit ( CodeZeroEvent . error , err ) ;
4443} ) ;
4544
4645action . on ( CodeZeroEvent . moduleUpdated , ( message : any ) => {
Original file line number Diff line number Diff line change @@ -28,15 +28,14 @@ action.on(CodeZeroEvent.error, (error: Error) => {
2828 console . error ( "Stream error:" , error . message ) ;
2929 console . log ( "Attempting to reconnect in 5s..." ) ;
3030 setTimeout ( ( ) => {
31- action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : unknown ) => {
32- console . error ( "Reconnect failed:" , err ) ;
33- } ) ;
31+ action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : Error ) => {
32+ action . emit ( CodeZeroEvent . error , err ) ;
33+ } )
3434 } , 5000 ) ;
3535} ) ;
3636
37- action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : unknown ) => {
38- console . error ( "Failed to connect:" , err ) ;
39- process . exit ( 1 ) ;
37+ action . connect ( process . env . AUTH_TOKEN ?? "your_auth_token_here" ) . catch ( ( err : Error ) => {
38+ action . emit ( CodeZeroEvent . error , err ) ;
4039} ) ;
4140
4241action . on ( CodeZeroEvent . moduleUpdated , ( message : any ) => {
You can’t perform that action at this time.
0 commit comments