introduce UserFacingException
we should not raise generic Exception when wanting to communicate with the user. it makes distinguishing programming errors and messages hard, as the caller will necessarily need to catch all Exceptions then
This commit is contained in:
@@ -119,6 +119,10 @@ class WalletFileException(Exception): pass
|
||||
class BitcoinException(Exception): pass
|
||||
|
||||
|
||||
class UserFacingException(Exception):
|
||||
"""Exception that contains information intended to be shown to the user."""
|
||||
|
||||
|
||||
# Throw this exception to unwind the stack like when an error occurs.
|
||||
# However unlike other exceptions the user won't be informed.
|
||||
class UserCancelled(Exception):
|
||||
|
||||
Reference in New Issue
Block a user