Success and failure messages are sent to the notification daemon if requested (user facing)
All errors are printed with tracing instead of panics. ashpd also supports tracing with useful messages
Screenshot cancellation doesn't panic anymore
Essentially, I refactored error handling to not panic but instead log errors and send status notifications. Error messages for users (the notifications) are less verbose than the logged messages. This is the to_user_facing() function on Error. For example, if screenshots or specific screenshot features are unsupported by the portal (i.e. if the user is using a different portal for screenshots), then a "Portal does not support screenshots" notification is posted.
Todo
I implemented the main changes already, but I would like to check if this patch is desirable and, if so, what I should do to improve it. The user facing messages should be probably be cleaned up or maybe even reduced. I also noticed that GNOME translates its screenshot errors. I can add fluent for parity with GNOME and the other COSMIC apps too.
Overview
tracing
instead of panics.ashpd
also supportstracing
with useful messagesEssentially, I refactored error handling to not panic but instead log errors and send status notifications. Error messages for users (the notifications) are less verbose than the logged messages. This is the
to_user_facing()
function onError
. For example, if screenshots or specific screenshot features are unsupported by the portal (i.e. if the user is using a different portal for screenshots), then a "Portal does not support screenshots" notification is posted.Todo
I implemented the main changes already, but I would like to check if this patch is desirable and, if so, what I should do to improve it. The user facing messages should be probably be cleaned up or maybe even reduced. I also noticed that GNOME translates its screenshot errors. I can add
fluent
for parity with GNOME and the other COSMIC apps too.