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 = {
372372 this . _notifyForSource ( source , ndata ) ;
373373 return invocation . return_value ( GLib . Variant . new ( '(u)' , [ id ] ) ) ;
374374 } 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+ }
376386 }
377387 }
378388
@@ -411,7 +421,12 @@ NotificationDaemon.prototype = {
411421 delete this . _senderToPid [ sender ] ;
412422 } ) ) ;
413423 }
414- this . _notifyForSource ( source , ndata ) ;
424+
425+ try {
426+ this . _notifyForSource ( source , ndata ) ;
427+ } catch ( e ) {
428+ global . logError ( e ) ;
429+ }
415430 } ) ) ;
416431
417432 return invocation . return_value ( GLib . Variant . new ( '(u)' , [ id ] ) ) ;
You can’t perform that action at this time.
0 commit comments