File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -325,7 +325,8 @@ function readScriptFromHttp(remote) {
325325 const res = yield ( 0 , import_index . fetch ) ( remote ) ;
326326 if ( ! res . ok ) {
327327 console . error ( `Error: Can't get ${ remote } ` ) ;
328- import_node_process2 . default . exit ( 1 ) ;
328+ import_node_process2 . default . exitCode = 1 ;
329+ throw new import_index . Fail ( `Failed to fetch remote script: ${ remote } (${ res . status } )` ) ;
329330 }
330331 return res . text ( ) ;
331332 } ) ;
Original file line number Diff line number Diff line change @@ -252,7 +252,8 @@ async function readScriptFromHttp(remote: string): Promise<string> {
252252 const res = await fetch ( remote )
253253 if ( ! res . ok ) {
254254 console . error ( `Error: Can't get ${ remote } ` )
255- process . exit ( 1 )
255+ process . exitCode = 1
256+ throw new Fail ( `Failed to fetch remote script: ${ remote } (${ res . status } )` )
256257 }
257258 return res . text ( )
258259}
Original file line number Diff line number Diff line change @@ -285,6 +285,8 @@ console.log(a);
285285 const server = await fakeServer ( [ `HTTP/1.1 500\n\n500\n` ] ) . listen ( port )
286286 const out = await $ `node build/cli.js http://127.0.0.1:${ port } ` . nothrow ( )
287287 assert . match ( out . stderr , / E r r o r : C a n ' t g e t / )
288+ assert . match ( out . stderr , / F a i l e d t o f e t c h r e m o t e s c r i p t / )
289+ assert . equal ( out . exitCode , 1 )
288290 await server . stop ( )
289291 } )
290292
You can’t perform that action at this time.
0 commit comments