File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,9 @@ export const curl = (
26
26
curl . setOpt ( "HEADER" , 1 ) ;
27
27
curl . setOpt ( "VERBOSE" , false ) ;
28
28
curl . setOpt ( "CUSTOMREQUEST" , method ) ;
29
- curl . on ( "error" , ( ) => {
29
+ curl . on ( "error" , ( error ) => {
30
30
curl . close ( ) ;
31
+ console . log ( "Got an error (on error)" , error ) ;
31
32
return resolve ( { httpCode : 0 , totalTime : 0 , data : "" } ) ;
32
33
} ) ;
33
34
curl . on ( "end" , ( _ , data ) => {
@@ -39,8 +40,10 @@ export const curl = (
39
40
totalTime = Number ( curl . getInfo ( "TOTAL_TIME" ) ) ;
40
41
} catch ( error ) {
41
42
curl . close ( ) ;
43
+ console . log ( "Got an error (on end)" , error ) ;
42
44
return resolve ( { httpCode, totalTime, data } ) ;
43
45
}
46
+ if ( httpCode === 0 || totalTime === 0 ) console . log ( "Didn't get an error but got 0s" ) ;
44
47
return resolve ( { httpCode, totalTime, data } ) ;
45
48
} ) ;
46
49
curl . perform ( ) ;
You can’t perform that action at this time.
0 commit comments