Skip to content

feat(errors): add rule_id to AnalysisSkippedByRuleError - #183

Merged
matany90 merged 1 commit into
masterfrom
feat/skipped-by-rule-error-rule-id
Oct 25, 2026
Merged

matany90 merged 1 commit into
masterfrom
feat/skipped-by-rule-error-rule-id

Conversation

@matany90

Copy link
Copy Markdown
Contributor

TLDR

AnalysisSkippedByRuleError now exposes rule_id, the id of the rule that skipped the analysis, read from result.rule_id in the 409 body when the server provides it.

Changes

  • AnalysisSkippedByRuleError.rule_id (str | None), parsed defensively from the response; None when the body has no result, no rule_id, or is not JSON.
  • Unit tests for the four body shapes.
  • Version 1.27.9 and CHANGES entry.

Full description

Services that catch AnalysisSkippedByRuleError currently have to reach into error.response.json() to learn which rule caused the skip. Newer server versions include rule_id next to is_skipped_by_rule in the 409 result; this change surfaces it as a plain attribute, mirroring how AnalysisRateLimitError exposes its headers. Backward compatible: the attribute is simply None against servers that do not send it.

🤖 Generated with Claude Code

@matany90
matany90 force-pushed the feat/skipped-by-rule-error-rule-id branch from 127f631 to 9f6a03d Compare October 25, 2026 10:57
Comment thread tests/unit/test_errors.py Outdated

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.

remove

When the server skips an analysis because a rule matched, the 409 body can
carry the id of that rule under result.rule_id. Expose it on the error so
callers can report which rule caused the skip without parsing the response.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@matany90
matany90 force-pushed the feat/skipped-by-rule-error-rule-id branch from 9f6a03d to 8b51194 Compare October 25, 2026 11:16
@matany90
matany90 merged commit 8e98e56 into master Oct 25, 2026
8 checks passed
@matany90
matany90 deleted the feat/skipped-by-rule-error-rule-id branch October 25, 2026 11:55
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