mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2024-11-10 17:47:13 +08:00
Merge pull request #245 from USA-RedDragon/develop
Fix wrapped JSON Decode error from requests
This commit is contained in:
commit
6ec5ca9ac2
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
from json import JSONDecodeError
|
||||
|
||||
from requests.exceptions import JSONDecodeError as requestsJSONDecodeError
|
||||
|
||||
from modules import util
|
||||
from modules.util import Failed
|
||||
|
||||
|
@ -70,7 +72,7 @@ class Webhooks:
|
|||
response.status_code >= 400 or ("result" in response_json and response_json["result"] == "error")
|
||||
) and skip is False:
|
||||
raise Failed(f"({response.status_code} [{response.reason}]) {response_json}")
|
||||
except JSONDecodeError:
|
||||
except (JSONDecodeError, requestsJSONDecodeError):
|
||||
if response.status_code >= 400:
|
||||
raise Failed(f"({response.status_code} [{response.reason}])")
|
||||
|
||||
|
|
Loading…
Reference in a new issue