Beispiel #1
0
 def handle_exception(exception):
     return fail(500, str(exception))
Beispiel #2
0
def handle_405_error(err):
    return fail(405, "Method not allowed.")
Beispiel #3
0
def handle_http_exception(exception):
    return fail(exception.code, exception.message, exception.meta)
Beispiel #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})
Beispiel #5
0
def handle_404_error(err):
    return fail(404, "Page not found.")
Beispiel #6
0
 def handle_exception(exception):
     return fail(500, str(exception))
Beispiel #7
0
def handle_http_exception(exception):
    return fail(exception.code, exception.message, exception.meta)
Beispiel #8
0
def handle_405_error(err):
    return fail(405, "Method not allowed.")
Beispiel #9
0
def handle_404_error(err):
    return fail(404, "Page not found.")
Beispiel #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 })