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 {
2424 }
2525 } ) ;
2626
27- this . logger . log ( `Fetching challenges from: ${ url . toString ( ) } ` ) ;
27+ const stringUrl = url . toString ( ) ;
28+ this . logger . log ( `Fetching challenges from: "${ stringUrl } "` ) ;
2829
2930 const headers : Record < string , string > = {
3031 'Content-Type' : 'application/json' ,
@@ -35,12 +36,17 @@ export class TopcoderChallengesService {
3536 }
3637
3738 this . logger . log (
38- `Fetching challenges with headers: ${ JSON . stringify ( headers ) } ` ,
39+ `Fetching challenges with headers: " ${ JSON . stringify ( headers ) } " ` ,
3940 ) ;
4041
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+ }
4551 }
4652}
You can’t perform that action at this time.
0 commit comments