Improve text for error messages

This commit is contained in:
David McDonald
2020-01-24 17:32:41 +00:00
parent 7a019df5a2
commit f861da1843
4 changed files with 34 additions and 26 deletions

View File

@@ -88,12 +88,12 @@ def register_errors(blueprint):
@blueprint.errorhandler(401)
def unauthorized(e):
error_message = "Unauthorized, authentication token must be provided"
error_message = "Unauthorized: authentication token must be provided"
return jsonify(result='error', message=error_message), 401, [('WWW-Authenticate', 'Bearer')]
@blueprint.errorhandler(403)
def forbidden(e):
error_message = "Forbidden, invalid authentication token provided"
error_message = "Forbidden: invalid authentication token provided"
return jsonify(result='error', message=error_message), 403
@blueprint.errorhandler(429)