-
Couldn't load subscription status.
- Fork 3
add more logs #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add more logs #11
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,8 @@ export class TopcoderChallengesService { | |
| } | ||
| }); | ||
|
|
||
| this.logger.log(`Fetching challenges from: ${url.toString()}`); | ||
| const stringUrl = url.toString(); | ||
| this.logger.log(`Fetching challenges from: "${stringUrl}"`); | ||
|
|
||
| const headers: Record<string, string> = { | ||
| 'Content-Type': 'application/json', | ||
|
|
@@ -35,12 +36,17 @@ export class TopcoderChallengesService { | |
| } | ||
|
|
||
| this.logger.log( | ||
| `Fetching challenges with headers: ${JSON.stringify(headers)}`, | ||
| `Fetching challenges with headers: "${JSON.stringify(headers)}"`, | ||
| ); | ||
|
|
||
| return fetch(url.toString(), { | ||
| method: 'GET', | ||
| headers, | ||
| }); | ||
| try { | ||
| return await fetch(stringUrl, { | ||
| method: 'GET', | ||
| headers, | ||
| }); | ||
| } catch (error) { | ||
| this.logger.error(`Error fetching challenges: ${JSON.stringify(error)}`, error); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. medium |
||
| throw error; | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
high
correctness
The
awaitkeyword is used here, but the function is not marked asasync. This will result in a syntax error. Ensure the function is declared asasyncto handle theawaitcorrectly.