1
0

contact/invoice import: better exception handling.

see #3904
This commit is contained in:
SomberNight
2018-02-14 19:42:35 +01:00
parent 7f04c30567
commit 909c063eb1
5 changed files with 38 additions and 8 deletions

View File

@@ -58,6 +58,19 @@ class InvalidPassword(Exception):
def __str__(self):
return _("Incorrect password")
class FileImportFailed(Exception):
def __str__(self):
return _("Failed to import file.")
class FileImportFailedEncrypted(FileImportFailed):
def __str__(self):
return (_('Failed to import file.') + ' ' +
_('Perhaps it is encrypted...') + '\n' +
_('Importing encrypted files is not supported.'))
# 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):