Skip to content

Commit 91a8914

Browse files
handle possibility of no problems in InvalidQueryException
1 parent 1910188 commit 91a8914

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/_incydr_sdk/file_events/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ def __init__(self, query=None, exception=None):
2020
"400 Response Error: Invalid query. Please double check your query filters are valid. "
2121
"\nTip: Make sure you're specifying your filter fields in dot notation. "
2222
"\nFor example, filter by 'file.archiveId' to filter by the archiveId field within the file object.)"
23-
f"\nRaw problem data from the response: {exception.response.json()['problems']}"
2423
)
24+
if 'problems' in exception.response.json().keys():
25+
self.message += f"\nRaw problem data from the response: {exception.response.json()['problems']}"
2526
self.original_exception = exception
2627
super().__init__(self.message)
2728

0 commit comments

Comments
 (0)