diff options
Diffstat (limited to 'common/src/leap/soledad/common/errors.py')
-rw-r--r-- | common/src/leap/soledad/common/errors.py | 64 |
1 files changed, 10 insertions, 54 deletions
diff --git a/common/src/leap/soledad/common/errors.py b/common/src/leap/soledad/common/errors.py index 5798770b..0b6bb4e6 100644 --- a/common/src/leap/soledad/common/errors.py +++ b/common/src/leap/soledad/common/errors.py @@ -132,67 +132,23 @@ class CouldNotObtainLockError(SoledadError): # -# CouchDatabase errors -# - -@register_exception -class MissingDesignDocError(SoledadError): - - """ - Raised when trying to access a missing couch design document. - """ - - wire_description = "missing design document" - status = 500 - - -@register_exception -class MissingDesignDocNamedViewError(SoledadError): - - """ - Raised when trying to access a missing named view on a couch design - document. - """ - - wire_description = "missing design document named function" - status = 500 - - -@register_exception -class MissingDesignDocListFunctionError(SoledadError): - - """ - Raised when trying to access a missing list function on a couch design - document. - """ - - wire_description = "missing design document list function" - status = 500 +# SoledadBackend errors +# u1db error statuses also have to be updated +http_errors.ERROR_STATUSES = set( + http_errors.wire_description_to_status.values()) -@register_exception -class MissingDesignDocDeletedError(SoledadError): +class InvalidURLError(Exception): """ - Raised when trying to access a deleted couch design document. + Exception raised when Soledad encounters a malformed URL. """ - wire_description = "design document was deleted" - status = 500 - - -@register_exception -class DesignDocUnknownError(SoledadError): +class BackendNotReadyError(SoledadError): """ - Raised when trying to access a couch design document and getting an - unknown error. + Generic exception raised when the backend is not ready to dispatch a client + request. """ - - wire_description = "missing design document unknown error" + wire_description = "backend not ready" status = 500 - - -# u1db error statuses also have to be updated -http_errors.ERROR_STATUSES = set( - http_errors.wire_description_to_status.values()) |