fix: log bounty fetch failures#825
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
lib/models/SyndicateJob.ts (1)
84-90: Include request context in the debug log for faster triage.This now logs failures (great), but adding
i18nandurlwill make mismatch investigations much easier.Suggested patch
.catch((error) => { const errorMessage = error instanceof Error ? error.message : String(error); logger?.debug( - `Failed to fetch bounty rewards for ${location}: ${errorMessage}` + `Failed to fetch bounty rewards (i18n=${i18n}, location=${location ?? 'unknown'}, url=${url}): ${errorMessage}` ); });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/models/SyndicateJob.ts` around lines 84 - 90, The debug log in the catch block that currently logs `location` and `errorMessage` should also include the request context `i18n` and `url` to aid triage; update the `logger?.debug` call inside the `.catch` (in SyndicateJob.ts where `errorMessage` is computed) to include `i18n` and `url` in the log message or structured fields (ensure `i18n` and `url` are in scope or passed into the surrounding function), keeping `location` and `errorMessage` intact for full context.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@lib/models/SyndicateJob.ts`:
- Around line 84-90: The debug log in the catch block that currently logs
`location` and `errorMessage` should also include the request context `i18n` and
`url` to aid triage; update the `logger?.debug` call inside the `.catch` (in
SyndicateJob.ts where `errorMessage` is computed) to include `i18n` and `url` in
the log message or structured fields (ensure `i18n` and `url` are in scope or
passed into the surrounding function), keeping `location` and `errorMessage`
intact for full context.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b233ac7a-821e-4f07-aad8-b6148ff1c52d
📒 Files selected for processing (1)
lib/models/SyndicateJob.ts
11a75a2 to
ae6ec03
Compare
4b4e39a to
e17a389
Compare
What did you fix?
references #821
Technically this does not fix anything, just helps provide more insight into what's going wrong with bounty rewards in the world state.
Reproduction steps
https://api.warframestat.us/pc/https://api.warframe.com/cdn/worldState.php['Pattern Mismatch. Results inaccurate.'].Evidence/screenshot/link to line
This only adds a debug statement to log errors instead of swallowing them, to help check what the actual issue is.
Considerations
Summary by CodeRabbit