mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2024-11-10 17:47:13 +08:00
Show trigger not enabled error in debug only
This commit is contained in:
parent
6799d4db8b
commit
2eba2bc94d
1 changed files with 8 additions and 2 deletions
|
@ -41,13 +41,19 @@ class Webhooks:
|
|||
response = self.config.post(f"{self.apprise.api_url}/notify", json=json)
|
||||
else:
|
||||
response = self.config.post(webhook, json=json)
|
||||
|
||||
skip = False
|
||||
try:
|
||||
response_json = response.json()
|
||||
if self.config.trace_mode:
|
||||
logger.debug(f"Response: {response_json}")
|
||||
if "result" in response_json and response_json["result"] == "error" and "details" in response_json and "response" in response_json["details"]:
|
||||
raise Failed(f"Notifiarr Error: {response_json['details']['response']}")
|
||||
if response.status_code >= 400 or ("result" in response_json and response_json["result"] == "error"):
|
||||
if ('trigger is not enabled' in response_json['details']['response']):
|
||||
logger.debug(f"Notifiarr Warning: {response_json['details']['response']}")
|
||||
skip = True
|
||||
else:
|
||||
raise Failed(f"Notifiarr Error: {response_json['details']['response']}")
|
||||
if (response.status_code >= 400 or ("result" in response_json and response_json["result"] == "error")) and skip == False:
|
||||
raise Failed(f"({response.status_code} [{response.reason}]) {response_json}")
|
||||
except JSONDecodeError:
|
||||
if response.status_code >= 400:
|
||||
|
|
Loading…
Reference in a new issue