Repository navigation
feat: notify the user if an extension has raised an exception #832
Description
Activity
@mattalexx :-) Feel free to create a PR.
I don't think Ulauncher can really handle extension errors other than logging the output. They run as separate processes and Ulauncher doesn't control their runtime. Some extensions will also trigger lots of error but still function, because of being implemented in a rush or by hobby developers, so even if we could it may not be something we should do.
I'm not sure if this is too "developer"-y a feature, but perhaps having a global or per extension "Be notified of errors on submission" flag would be good.
The extension list contains a lot of abandonded projects, and it's hard to tell which is which without doing your own investigation.
Just a suggestion.. I would work on a PR if you agreed, since I'm already planning on running a patched build with this feature, sans UI.
Reacted by Albin LarssonI'm open to the idea. We need other debugging improvements as well (#818), and could perhaps combine them.
I realize I had the need for this myself for an extension. I'm importing gir1.2-notify to send notifications manually if there is a dependency runtime exception for https://github.com/friday/ulauncher-clipboard
But since Ulauncher 6 removed the gir1.2-notify dependency in favor of Gio.Application.send_notification, it would be nice to expose a way for extensions to send these, and the suggestion here would also work with raising an exceptions manually, but it needs to apply more widely for raised exceptions (not just on item enter).
Maybe that'll be annoying/verbose, but we can tune it later, or add ways to opt out completely or per extension.Will add this to the v6 milestone and hopefully get it included soon. Not sure yet how we want to handle it
- changed the title
[-]Ulauncher should alert the user if an extension has thrown an error during `ItemEnterEventListener` [/-][+]feat: notify the user if an extension has raised an exception[/+]on Apr 1, 2024 I started working on this more than one time, but the extension <-> Ulauncher communication makes it hard.
We can catch the exception in the Extension class listeners. Then it needs to be sent to Ulauncher with the socket JSONFramer. This is quite a messy internal logic that is hard to work with. If someone wants to help it's very welcome.
Steps to reproduce
Current behavior
/var/login vain!Side Note: All joking aside, @cmuench, I should have verified that it was working. I really like the extension and I plan to submit a PR in the next few days :-)
Expected behavior
An error notification of some kind, so the user knows that the action they just took may not have produce the desired result.
Environment
Ulauncher version: 5.14.0
Linux distro: Arch Linux, updated at least weekly.
Desktop environment: KDE Plasma 5.23.1-1
Logs
https://gist.github.com/mattalexx/cb19f616d70bc5e5a5db32bc78a95079