Skip to content

fix(intel): add console.warn to silent catch blocks for observability#807

Open
NewCoder3294 wants to merge 1 commit into
koala73:mainfrom
NewCoder3294:fix/intel-handler-observability
Open

fix(intel): add console.warn to silent catch blocks for observability#807
NewCoder3294 wants to merge 1 commit into
koala73:mainfrom
NewCoder3294:fix/intel-handler-observability

Conversation

@NewCoder3294

Copy link
Copy Markdown
Collaborator

Summary

  • Addresses lint issue L-14: silent catch blocks in intelligence and military handlers are now observable in production logs
  • Added console.warn with handler-name prefixes (e.g. [get-country-intel-brief]) and the caught error to every previously-empty catch block across 4 files
  • No logic changes — only logging additions to existing catch blocks

Files modified

File Catch blocks updated
server/worldmonitor/intelligence/v1/get-country-intel-brief.ts 3 (context parse, GROQ fetch, cached fetch)
server/worldmonitor/intelligence/v1/classify-event.ts 3 (JSON.parse, classification fetch, cached fetch)
server/worldmonitor/intelligence/v1/get-pizzint-status.ts 3 (PizzINT API, GDELT fetch, cached fetch)
server/worldmonitor/military/v1/list-military-bases.ts 1 (JSON.parse of base metadata)

Test plan

  • Verify type checks pass (npm run typecheck) — confirmed passing in pre-push hook
  • Grep for console.warn in the 4 files to confirm all silent catches now log
  • Deploy to staging and trigger error paths to verify log output is present and grep-friendly
  • Confirm no behavioral changes — all catch blocks still return the same fallback values

🤖 Generated with Claude Code

@vercel

vercel Bot commented Mar 2, 2026

Copy link
Copy Markdown

@NewCoder3294 is attempting to deploy a commit to the Elie Team on Vercel.

A member of the Team first needs to authorize it.

@koala73 koala73 added Not Ready to Merge PR has conflicts, failing checks, or needs work Low Value Trivial, unnecessary, or not aligned with project needs labels Mar 3, 2026
@SebastienMelki

Copy link
Copy Markdown
Collaborator

@NewCoder3294 — this and #817 make identical changes (console.warn in silent catch blocks) across different modules. Please consolidate both into a single PR, rebased on main. Also consider including #833 (error message improvements) in the same batch since it follows the same observability theme.

Style note: prefer console.error over console.warn for caught exceptions in server-side handlers, as they represent unexpected failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Low Value Trivial, unnecessary, or not aligned with project needs Not Ready to Merge PR has conflicts, failing checks, or needs work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants