File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -51,10 +51,7 @@ export function Networks() {
51
51
async function disconnect ( ) {
52
52
try {
53
53
await clientStop ( ) ;
54
- setClientPid ( 0 ) ;
55
54
setMessage ( "info" , "Disconnected from Network" ) ;
56
- setIsConnected ( false ) ;
57
- setNetworkConnected ( "" ) ;
58
55
} catch ( error : any ) {
59
56
log . error ( `${ error } ` ) ;
60
57
setMessage ( "error" , `${ error } ` ) ;
@@ -160,9 +157,17 @@ export function Networks() {
160
157
const o = ( d : string ) => `${ d . trim ( ) } ` ;
161
158
log . debug ( `spawning command: ${ cmd } ${ args . join ( " " ) } ` ) ;
162
159
command . on ( "close" , ( data ) => {
160
+ // normal: code=null signal=9
161
+ // error: code=2 signal=null
163
162
log . debug ( `closed: ${ cmd } code=${ data . code } signal=${ data . signal } ` ) ;
164
- setMessage ( "info" , "Network client stopped." ) ;
163
+ if ( data . code !== null ) {
164
+ setMessage ( "error" , "Error: Network connection failed." ) ;
165
+ }
166
+ setClientPid ( 0 ) ;
167
+ setIsConnected ( false ) ;
168
+ setNetworkConnected ( "" ) ;
165
169
} ) ;
170
+
166
171
command . on ( "error" , ( e ) => log . error ( o ( e ) ) ) ;
167
172
168
173
command . stdout . on ( "data" , ( d ) => {
You can’t perform that action at this time.
0 commit comments