Log NTFY errors
This commit is contained in:
parent
092d4c64ff
commit
dd4b2ddd3a
|
@ -18,11 +18,14 @@ def raw_sendmsg(msg, title=None, priority=None, tags=None, url=None, topic=None)
|
||||||
headers["Priority"] = priority
|
headers["Priority"] = priority
|
||||||
if tags:
|
if tags:
|
||||||
headers["Tags"] = tags
|
headers["Tags"] = tags
|
||||||
|
try:
|
||||||
requests.post(
|
requests.post(
|
||||||
f"{url}/{topic}",
|
f"{url}/{topic}",
|
||||||
data=msg,
|
data=msg,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
)
|
)
|
||||||
|
except requests.exceptions.ConnectionError as e:
|
||||||
|
log.error(f"Error sending notification: {e}")
|
||||||
|
|
||||||
|
|
||||||
# Sendmsg helper to send a message to a user's notification settings
|
# Sendmsg helper to send a message to a user's notification settings
|
||||||
|
|
Loading…
Reference in New Issue