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