File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ export class TopcoderChallengesService {
24
24
}
25
25
} ) ;
26
26
27
- this . logger . log ( `Fetching challenges from: ${ url . toString ( ) } ` ) ;
27
+ const stringUrl = url . toString ( ) ;
28
+ this . logger . log ( `Fetching challenges from: "${ stringUrl } "` ) ;
28
29
29
30
const headers : Record < string , string > = {
30
31
'Content-Type' : 'application/json' ,
@@ -35,12 +36,17 @@ export class TopcoderChallengesService {
35
36
}
36
37
37
38
this . logger . log (
38
- `Fetching challenges with headers: ${ JSON . stringify ( headers ) } ` ,
39
+ `Fetching challenges with headers: " ${ JSON . stringify ( headers ) } " ` ,
39
40
) ;
40
41
41
- return fetch ( url . toString ( ) , {
42
- method : 'GET' ,
43
- headers,
44
- } ) ;
42
+ try {
43
+ return await fetch ( stringUrl , {
44
+ method : 'GET' ,
45
+ headers,
46
+ } ) ;
47
+ } catch ( error ) {
48
+ this . logger . error ( `Error fetching challenges: ${ JSON . stringify ( error ) } ` , error ) ;
49
+ throw error ;
50
+ }
45
51
}
46
52
}
You can’t perform that action at this time.
0 commit comments