Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.27.9
-------
- Add rule_id to AnalysisSkippedByRuleError with the id of the rule that skipped the analysis

1.27.8
-------
- Return None instead of raising when fetching a deleted analysis (410 Gone) by id, matching the documented from_analysis_id contract
Expand Down
2 changes: 1 addition & 1 deletion intezer_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.27.8'
__version__ = '1.27.9'
9 changes: 9 additions & 0 deletions intezer_sdk/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@ def __init__(self, response: requests.Response):
class AnalysisSkippedByRuleError(ServerError):
def __init__(self, response: requests.Response):
super().__init__('Analysis skipped by rule', response)
self.rule_id: str | None = self._parse_rule_id(response)

@staticmethod
def _parse_rule_id(response: requests.Response) -> str | None:
try:
result = response.json().get('result') or {}
except ValueError:
return None
return result.get('rule_id')


class AnalysisRateLimitError(ServerError):
Expand Down
Loading