Exemple #1
0
 def handle_exception(exception):
     return fail(500, str(exception))
Exemple #2
0
def handle_405_error(err):
    return fail(405, "Method not allowed.")
Exemple #3
0
def handle_http_exception(exception):
    return fail(exception.code, exception.message, exception.meta)
Exemple #4
0
def handle_validation_error(err):
    messages = [(name, msg[0])
                for name, msg in err.data["messages"].iteritems()]
    name, message = messages[0]
    return fail(422, message, {"field": name})
Exemple #5
0
def handle_404_error(err):
    return fail(404, "Page not found.")
Exemple #6
0
 def handle_exception(exception):
     return fail(500, str(exception))
Exemple #7
0
def handle_http_exception(exception):
    return fail(exception.code, exception.message, exception.meta)
Exemple #8
0
def handle_405_error(err):
    return fail(405, "Method not allowed.")
Exemple #9
0
def handle_404_error(err):
    return fail(404, "Page not found.")
Exemple #10
0
def handle_validation_error(err):
    messages = [(name, msg[0]) for name, msg in err.data["messages"].iteritems()]
    name, message = messages[0]
    return fail(422, message, { "field": name })