-
Couldn't load subscription status.
- Fork 3
test log #10
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
test log #10
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 |
|---|---|---|
|
|
@@ -54,6 +54,11 @@ export class QueryChallengesTool { | |
| this.logger.error( | ||
| `Failed to fetch challenges from Topcoder API: ${challenges.statusText}`, | ||
| ); | ||
| try { | ||
| this.logger.error(await challenges.json()); | ||
| } catch (e) { | ||
| this.logger.error('Failed to log challenge error'); | ||
| } | ||
|
|
||
| // Return an error response if the API call fails | ||
| return { | ||
|
|
@@ -108,7 +113,7 @@ export class QueryChallengesTool { | |
| }, | ||
| }; | ||
| } catch (error) { | ||
| this.logger.error(`Error fetching challenges: ${error.message}`); | ||
| this.logger.error(`Error fetching challenges: ${error.message}`, 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 |
||
| return { | ||
| content: [ | ||
| { | ||
|
|
||
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.
medium
correctness
Consider checking if
challengeshas a valid JSON response before attempting to parse it. This can prevent unnecessary exceptions and improve error handling.