summaryrefslogtreecommitdiff
path: root/mqtt-notify.py
diff options
context:
space:
mode:
Diffstat (limited to 'mqtt-notify.py')
-rwxr-xr-xmqtt-notify.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mqtt-notify.py b/mqtt-notify.py
index 5745c02..3e6bd9b 100755
--- a/mqtt-notify.py
+++ b/mqtt-notify.py
@@ -85,7 +85,11 @@ def on_message(client, userdata, msg):
n = notification_map[key][1]
n.update(subject, body, icon)
- n.show()
+ try:
+ n.show()
+ except GLib.GError as e:
+ print("Failed to show notification: {}".format(e), file=sys.stderr)
+ sys.exit(-1)
def on_disconnect(client, userdata, rc):
print("Disconnected")