Log failed notification
This commit is contained in:
1 parent
132fa12ef4
commit
12148217a2
1 file changed
+7
-8
@@ -149,16 +149,15 @@ class CoreNotifier(Notification):
|
|||||||
def notify(self, message = '', data = None, listener = None):
|
def notify(self, message = '', data = None, listener = None):
|
||||||
if not data: data = {}
|
if not data: data = {}
|
||||||
|
|
||||||
|
n = {
|
||||||
|
'_t': 'notification',
|
||||||
|
'time': int(time.time()),
|
||||||
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
db = get_db()
|
db = get_db()
|
||||||
|
|
||||||
data['notification_type'] = listener if listener else 'unknown'
|
n['message'] = toUnicode(message)
|
||||||
|
|
||||||
n = {
|
|
||||||
'_t': 'notification',
|
|
||||||
'time': int(time.time()),
|
|
||||||
'message': toUnicode(message)
|
|
||||||
}
|
|
||||||
|
|
||||||
if data.get('sticky'):
|
if data.get('sticky'):
|
||||||
n['sticky'] = True
|
n['sticky'] = True
|
||||||
@@ -171,7 +170,7 @@ class CoreNotifier(Notification):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
log.error('Failed notify: %s', traceback.format_exc())
|
log.error('Failed notify "%s": %s', (n, traceback.format_exc()))
|
||||||
|
|
||||||
def frontend(self, type = 'notification', data = None, message = None):
|
def frontend(self, type = 'notification', data = None, message = None):
|
||||||
if not data: data = {}
|
if not data: data = {}
|
||||||
|
|||||||
Reference in new issue
Block a user