Skip to content

Commit

Permalink
report error back to the caller if we cannot register the dialog
Browse files Browse the repository at this point in the history
we can only fall here if the path the caller expect us to use is already
used by an previous call, or different portal. since we cannot do much
here, we forward the error to the caller.

since falling to register the dialog don't cause issues to the portal daemon,
the critical is replaced by a warning.
  • Loading branch information
Marukesu committed Jan 15, 2023
1 parent be77bef commit 6953d75
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Access/Portal.vala
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ public class Access.Portal : Object {

try {
register_id = connection.register_object (handle, dialog);
} catch (Error e) {
critical (e.message);
} catch (IOError e) {
warning (e.message);
throw new DBusError.OBJECT_PATH_IN_USE (e.message);
}

dialog.present ();
Expand Down

0 comments on commit 6953d75

Please sign in to comment.