Unify json naming
This commit is contained in:
1 parent
3aaa14c986
commit
80dd89212f
4 files changed
+38
-38
No files matched your search
@@ -2,28 +2,28 @@ from app.api import bp_errors
|
||||
|
||||
@bp_errors.app_errorhandler(400)
|
||||
def bad_request(e):
|
||||
return {"Bad Request": "The request was incorrectly formatted, or contained invalid data"}, 400
|
||||
return {"msg": "The request was incorrectly formatted, or contained invalid data"}, 400
|
||||
|
||||
@bp_errors.app_errorhandler(401)
|
||||
def unauthorized(e):
|
||||
return {"Unauthorized": "Failed to authorize the request"}, 401
|
||||
return {"msg": "Failed to authorize the request"}, 401
|
||||
|
||||
@bp_errors.app_errorhandler(403)
|
||||
def forbidden(e):
|
||||
return {"Forbidden": "You shall not pass"}, 403
|
||||
return {"msg": "You shall not pass"}, 403
|
||||
|
||||
@bp_errors.app_errorhandler(404)
|
||||
def not_found(e):
|
||||
return {"Not Found": "The requested resource was not found"}, 404
|
||||
return {"msg": "The requested resource was not found"}, 404
|
||||
|
||||
@bp_errors.app_errorhandler(405)
|
||||
def method_not_allowed(e):
|
||||
return {"Method Not Allowed": "The method used is not allowed in current context"}, 405
|
||||
return {"msg": "The method used is not allowed in current context"}, 405
|
||||
|
||||
@bp_errors.app_errorhandler(500)
|
||||
def internal_error(e):
|
||||
return {"Internal Server Error": "An error occurred on he server"}, 500
|
||||
return {"msg": "An error occurred on he server"}, 500
|
||||
|
||||
@bp_errors.app_errorhandler(501)
|
||||
def internal_error(e):
|
||||
return {"Not Implemented": "This function has not been implemented yet. Check back soon!"}, 501
|
||||
return {"msg": "This function has not been implemented yet. Check back soon!"}, 501
|
||||
Reference in new issue
Block a user