def handle_exception(exception): return fail(500, str(exception))
def handle_405_error(err): return fail(405, "Method not allowed.")
def handle_http_exception(exception): return fail(exception.code, exception.message, exception.meta)
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})
def handle_404_error(err): return fail(404, "Page not found.")
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 })