Example #1
0
def base_exceptions_handler(error):
    return format_exception(str(*error.args), 500)
Example #2
0
def file_not_found_handler(error):
    return format_exception(str(*error.args), 404)
Example #3
0
def regex_error(error):
    return format_exception(str(*error.args), 500)
Example #4
0
def custom_exceptions_error_handler(error):
    if isinstance(error, CustomException):
        return format_exception(error.description, error.code)
Example #5
0
def bad_request_key_error(error):
    return format_exception(error.description, 500)
Example #6
0
def method_not_allowed_handler(error):
    return format_exception("Method is not allowed.", 405)
Example #7
0
def jinja_undefined_error(error):
    return format_exception(
        "Template values do not match data_json:" + str(*error.args), 500)
Example #8
0
def docx_package_not_found_error(error):
    return format_exception("Template file is invalid.", 500)
Example #9
0
def json_decode_error_handler(error):
    return format_exception("json_data is not in valid JSON format ", 500)