def handle_all_errors(error): try: response = JSON(error=error.to_dict().get('__all__')) except Exception: response = JSON(error=str(error)) response.status_code = 500 return response
def page_not_found(error): response = JSON(error=str(app.config['ERRORS']['404'])) response.status_code = 404 return response
def unauthorized(error): response = JSON(error=str(app.config['ERRORS']['401'])) response.status_code = 401 return response
def bad_request(error): response = JSON(error=str(app.config['ERRORS']['400'])) response.status_code = 400 return response
def service_unavailable_error(error): response = JSON(error=str(app.config['ERRORS']['503'])) response.status_code = 503 return response
def internal_server_error(error): response = JSON(error=str(app.config['ERRORS']['500'])) response.status_code = 500 return response
def handle_invalid_request(error): response = JSON(error.to_dict()) response.status_code = error.status_code return response