def error_handler(ctx): return current_app.response_class(error_to_json(ctx.exception), mimetype='application/json', status=400)