

def handle_error(code):
    'Display an error thrown outside a routed view function.\n\n    :param int code: Error status code\n    :return: Flask `Response` object\n\n    '
    from website.routes import OsfWebRenderer
    json_renderer = JSONRenderer()
    web_renderer = OsfWebRenderer('', render_mako_string)
    error = HTTPError(code)
    renderer = (json_renderer if is_json_request() else web_renderer)
    return make_response(renderer.handle_error(web_renderer))

dataset/ETHPy150Open CenterForOpenScience/osf.io/framework/transactions/utils.py handle_error/VarMisuse@60/141 `error`->`web_renderer`