Exemple #1
0
def not_found(error):
    not_found_error = ApiError(code=404,
                               title="Not Found",
                               detail="Endpoint not found",
                               status="NotFound")
    error_dict = not_found_error.to_dict()
    return make_json_response(errors=error_dict,
                              status_code=str(error_dict['code']))
Exemple #2
0
 def not_found(error):
     try:
         request_url = request.path
     except Exception as exp:
         request_url = "Unknown"
     not_found_error = ApiError(code=404,
                                title="Not Found",
                                detail="Endpoint not found",
                                status="NotFound",
                                source=request_url)
     error_dict = not_found_error.to_dict()
     return make_json_response(errors=error_dict,
                               status_code=str(error_dict['code']))