A better way to show Borg's errors
Description
Fixes #1940
I think it would be better to show Borg's error messages inside Vorta's exception dialog instead of relying on the tiny progress event box. Now most of Borgs' commands would have a "started" and "finished" messages appears in the progress event box, and the errors would appear in the exception dialog.
I also added finished_event function to mount and umuont, I'm not sure but I think it should have error handling also, just as the rest of the commands.
Now the command that doesn't have that change are info_archive, info_repo, init, version, and rename.
Related Issue
How Has This Been Tested?
I tested it by changing Borg's commands from the source code to force them to fail and return non-zero code, and the result for all the commands is just like the screen record.
Screen Record:
https://github.com/user-attachments/assets/229ef7b4-2bbb-4fcb-a9b1-6abb893f191b
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] I have read the CONTRIBUTING guide.
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.
Please review @VandalByte and let me know if this is suitable to be added. IIRC we already have an error dialog for the whole app in the code. This could reuse it, but just for Borg errors. Thanks!
I tested the changes by introducing errors, and everything works as expected for various borg commands.
One issue I encountered is with tests/integration/test_init.py::test_create_repo which has a test regarding creating a repo, even though the test is passing in my machine the new error dialog window just stays open and test is halted until I manually close that window.
I think the error already existed, but it didn’t affect the tests. Now that the new error dialog surfaces it in a separate window, it's causing the tests to hang.
I have added the fixes with the commit: https://github.com/borgbase/vorta/commit/c8ee821b12b14e22e070323c7fa9843479574cad on the branch https://github.com/borgbase/vorta/compare/master...VandalByte:vorta:fix-better-borg-error
The commit also includes some minor bug fixes for the previously merged Change Passphrase feature.
This also fixes my recent peeve with Vorta log display.