diff --git a/exception/__init__.py b/exception/__init__.py index 4b92945a..8b4feec0 100644 --- a/exception/__init__.py +++ b/exception/__init__.py @@ -2,24 +2,24 @@ def UnauthorizedException(message="", code=None): - raise ProblemException(401, "Unauthorized", message, "Unauthorized") + raise ProblemException(401, "Unauthorized", message, "Unauthorized", code) def ForbiddenException(message="", code=None): - raise ProblemException(403, "Forbidden", message, "Forbidden") + raise ProblemException(403, "Forbidden", message, "Forbidden", code) def NotFoundException(message="", code=None): - raise ProblemException(404, "Not Found", message, "NotFound") + raise ProblemException(404, "Not Found", message, "NotFound", code) def MethodNotAllowedException(message="", code=None): - raise ProblemException(405, "Method Not Allowed", message, "MethodNotAllowed") + raise ProblemException(405, "Method Not Allowed", message, "MethodNotAllowed", code) def InternalServerErrorException(message="", code=None): - raise ProblemException(500, "Internal Server Error", message, "InternalServerError") + raise ProblemException(500, "Internal Server Error", message, "InternalServerError", code) def NotImplementedException(message="", code=None): - raise ProblemException(501, "Not Implemented", message, "NotImplemented") + raise ProblemException(501, "Not Implemented", message, "NotImplemented", code) diff --git a/exception/messages.py b/exception/messages.py index 402cc1ce..705ef31e 100644 --- a/exception/messages.py +++ b/exception/messages.py @@ -21,3 +21,4 @@ MESSAGE_CODE_SUBMISSION_IRRELEVANT_VERSION_CANNOT_BE_MAPPED = 19 MESSAGE_CODE_SUBMISSION_NOT_FOUND = 21 # next: 23 +# Do not change the numbers and new always. These are linked to client applications.