We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c6ed39 commit 2885fd4Copy full SHA for 2885fd4
nightfall/api.py
@@ -253,10 +253,9 @@ def _validate_response(response: requests.Response, expected_status_code: int):
253
return
254
response_json = response.json()
255
error_code = response_json.get('code', None)
256
- if error_code is not None:
257
- if error_code < 40000 or error_code >= 50000:
258
- raise NightfallSystemError(response.text, error_code)
259
- else:
260
- raise NightfallUserError(response.text, error_code)
261
+ if error_code is None:
262
raise NightfallSystemError(response.text, 50000)
+ if error_code < 40000 or error_code >= 50000:
+ raise NightfallSystemError(response.text, error_code)
+ else:
+ raise NightfallUserError(response.text, error_code)
0 commit comments