

def get_error_html(self, status_code, **kwargs):
    self.set_header('Content-Type', 'application/json')
    if (status_code == 400):
        resp = {
            'error': 400,
            'reason': 'bad_request',
        }
    elif (status_code == 404):
        resp = {
            'error': 404,
            'reason': 'not_found',
        }
    elif (status_code == 409):
        resp = {
            'error': 409,
            'reason': 'conflict',
        }
    elif (status_code == 401):
        resp = {
            'error': 401,
            'reason': 'unauthorized',
        }
    elif (status_code == 403):
        resp = {
            'error': 403,
            'reason': 'forbidden',
        }
    else:
        resp = {
            'error': status_code,
            'reason': httplib.responses[resp],
        }
    if (self.settings.get('debug') and ('exc_info' in kwargs)):
        exc_info = traceback.format_exception(*kwargs['exc_info'])
        resp['exc_info'] = exc_info
    return json.dumps(resp)

dataset/ETHPy150Open benoitc/gaffer/gaffer/gafferd/http_handlers/util.py CorsHandler.get_error_html/VarMisuse@173/238 `status_code`->`resp`