Skip to content

fix(cdp_monitoring): skip 422 errors per item instead of crashing#439

Merged
talhaahmad-supp merged 1 commit into
masterfrom
fix/cdp-monitoring-422-error-handling
Jun 9, 2026
Merged

fix(cdp_monitoring): skip 422 errors per item instead of crashing#439
talhaahmad-supp merged 1 commit into
masterfrom
fix/cdp-monitoring-422-error-handling

Conversation

@talhaahmad-supp

@talhaahmad-supp talhaahmad-supp commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Three cdp_monitoring ingest scripts (ingest_activation.py, ingest_journey_summary.py, ingest_journey_activation.py) crash entirely when any single item returns a 422 from the CDP API
  • Wrapped the per-item API call in each loop with try/except requests.exceptions.HTTPError so bad items are logged and skipped while all other records continue to ingest

Test plan

  • Verify that a 422 response on one audience/journey ID no longer aborts the full run
  • Confirm skipped IDs appear in the workflow task logs as Skipping audience/journey <id>: ...
  • Confirm all non-422 rows are still written to activations, journey_summary, and journey_activation tables

🤖 Generated with Claude Code

A single 422 response from the CDP API was raising an unhandled
HTTPError and aborting the entire ingest loop. Wrap each per-item
call in try/except so bad items are skipped and logged while all
other records continue to ingest normally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@talhaahmad-supp talhaahmad-supp requested a review from a team as a code owner June 8, 2026 15:43

@o-mura o-mura left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the exception handling!

@talhaahmad-supp talhaahmad-supp merged commit 4aa10c0 into master Jun 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants