from flask import json


def error_handler(e):
    response = e.get_response()
    # replace the body with JSON
    response.data = json.dumps({
        "code": e.code,
        "name": e.name,
        "description": e.description,
    })
    response.content_type = "application/json"
    return response

76d06b0b7d63d56ca453593293a8c261f0a2e32a
<mask token>

<mask token>


def error_handler(e):
    response = e.get_response()
    response.data = json.dumps({'code': e.code, 'name': e.name,
        'description': e.description})
    response.content_type = 'application/json'
    return response

from flask import json


def error_handler(e):
    response = e.get_response()
    response.data = json.dumps({'code': e.code, 'name': e.name,
        'description': e.description})
    response.content_type = 'application/json'
    return response

from flask import json


def error_handler(e):
    response = e.get_response()
    # replace the body with JSON
    response.data = json.dumps({
        "code": e.code,
        "name": e.name,
        "description": e.description,
    })
    response.content_type = "application/json"
    return response
