pop-os / cosmic-screenshot

Utility for capturing screenshots via XDG Desktop Portal
GNU General Public License v3.0
20 stars 8 forks source link

[Need comments, low importance] Improve error reporting #6

Open joshuamegnauth54 opened 6 months ago

joshuamegnauth54 commented 6 months ago

Overview

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.