karlify the exception messages

also create a PDFNotReadyError class, separate to BadRequestError, to
imply to the end user that this is something they should handle
separately to all the other errors
This commit is contained in:
Leo Hemsted
2019-09-17 12:16:24 +01:00
parent 1ad32c9168
commit efaa4f2ad2
3 changed files with 23 additions and 26 deletions

View File

@@ -57,6 +57,11 @@ class BadRequestError(InvalidRequest):
self.message = message if message else self.message
class PDFNotReadyError(BadRequestError):
def __init__(self):
super().__init__(message='PDF not available yet, try again later', status_code=400)
def register_errors(blueprint):
@blueprint.errorhandler(InvalidEmailError)
def invalid_format(error):