File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -372,7 +372,17 @@ NotificationDaemon.prototype = {
372
372
this . _notifyForSource ( source , ndata ) ;
373
373
return invocation . return_value ( GLib . Variant . new ( '(u)' , [ id ] ) ) ;
374
374
} catch ( e ) {
375
- return invocation . return_gerror ( e ) ;
375
+ global . logError ( e ) ;
376
+ if ( e instanceof GLib . Error ) {
377
+ return invocation . return_gerror ( e ) ;
378
+ } else {
379
+ let name = e . name ;
380
+ if ( ! name . includes ( '.' ) ) {
381
+ name = `org.gnome.gjs.JSError.${ name } ` ;
382
+ }
383
+
384
+ return invocation . return_dbus_error ( name , e . message ) ;
385
+ }
376
386
}
377
387
}
378
388
@@ -411,7 +421,12 @@ NotificationDaemon.prototype = {
411
421
delete this . _senderToPid [ sender ] ;
412
422
} ) ) ;
413
423
}
414
- this . _notifyForSource ( source , ndata ) ;
424
+
425
+ try {
426
+ this . _notifyForSource ( source , ndata ) ;
427
+ } catch ( e ) {
428
+ global . logError ( e ) ;
429
+ }
415
430
} ) ) ;
416
431
417
432
return invocation . return_value ( GLib . Variant . new ( '(u)' , [ id ] ) ) ;
You can’t perform that action at this time.
0 commit comments