-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor recoverable exception handling
Previously, I was explicitly raising IndexError and TypeError for recoverable errors (like when a user enters a non-existing index as an argument, or attempt to activate a download, for example), and catching them in the UI class. This is bad for multiple reasons, but the main one is that it can potentially mask logical errors. I would prefer a logical error crash so I can find and fix the bug. This commit demotes all recoverable errors to the built-in Warning(), and makes the UI class only except (accept?) Warnings. This also removes the "vanilla" command, in favor of: ``` deactivate mod all commit ``` Finally, this change makes it so the UI class doesn't expect a return status from functions in the controller. All controller methods are assumed to be successful if they don't raise a Warning (recoverable) or an Exception of any kind (now correctly crashes). This is the first step towards moving business logic out of the UI class, which will allow it to be generalized, then recycled for the upcoming fomod controller.
- Loading branch information
1 parent
eb0510e
commit 2d5369a
Showing
6 changed files
with
152 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.