2005-07-16 00:52:08 +08:00
|
|
|
"Global Django exceptions"
|
2005-07-13 09:25:57 +08:00
|
|
|
|
2006-05-02 09:31:56 +08:00
|
|
|
class ObjectDoesNotExist(Exception):
|
2005-07-13 09:25:57 +08:00
|
|
|
"The requested object does not exist"
|
2006-05-02 09:31:56 +08:00
|
|
|
silent_variable_failure = True
|
2005-07-13 09:25:57 +08:00
|
|
|
|
2007-12-03 02:21:07 +08:00
|
|
|
class MultipleObjectsReturned(Exception):
|
|
|
|
"The query returned multiple objects when only one was expected."
|
|
|
|
pass
|
|
|
|
|
2005-07-13 09:25:57 +08:00
|
|
|
class SuspiciousOperation(Exception):
|
|
|
|
"The user did something suspicious"
|
|
|
|
pass
|
|
|
|
|
|
|
|
class PermissionDenied(Exception):
|
|
|
|
"The user did not have permission to do that"
|
|
|
|
pass
|
|
|
|
|
|
|
|
class ViewDoesNotExist(Exception):
|
|
|
|
"The requested view does not exist"
|
|
|
|
pass
|
|
|
|
|
|
|
|
class MiddlewareNotUsed(Exception):
|
|
|
|
"This middleware is not used in this server configuration"
|
2005-07-16 00:52:08 +08:00
|
|
|
pass
|
2005-07-17 06:12:24 +08:00
|
|
|
|
|
|
|
class ImproperlyConfigured(Exception):
|
|
|
|
"Django is somehow improperly configured"
|
|
|
|
pass
|