File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ export async function request(options: { type: string; url: string; headers: Rec
2323 headers : options . headers ,
2424 agent : new ProxyAgent ( ) ,
2525 secureContext,
26- timeout : 60000 ,
2726 } ;
2827
2928 const offline_mode : boolean = ( process . env . OFFLINE_MODE ?? 'false' ) === 'true' ;
3029 if ( offline_mode ) {
31- output . write ( 'Offline mode enabled, skipping request' , LogLevel . Warning ) ;
32- return ;
30+ // Use the exception handling as a signal to skip the request
31+ const err = `Offline mode enabled. Aboring request.` ;
32+ throw new Error ( err ) ;
3333 }
3434
3535 const plainHTTP = parsed . protocol === 'http:' || parsed . hostname === 'localhost' ;
@@ -48,10 +48,6 @@ export async function request(options: { type: string; url: string; headers: Rec
4848 res . on ( 'end' , ( ) => resolve ( Buffer . concat ( chunks ) ) ) ;
4949 }
5050 } ) ;
51- req . on ( 'timeout' , ( ) => {
52- output . write ( 'Request timed out, aborting' , LogLevel . Warning ) ;
53- req . destroy ( ) ;
54- } ) ;
5551 req . on ( 'error' , reject ) ;
5652 if ( options . data ) {
5753 req . write ( options . data ) ;
You can’t perform that action at this time.
0 commit comments