Changeset View
Changeset View
Standalone View
Standalone View
swh/web/common/exc.py
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | if get_config()["debug"]: | ||||
error_description = traceback.format_exc() | error_description = traceback.format_exc() | ||||
if isinstance(exc, BadInputExc): | if isinstance(exc, BadInputExc): | ||||
error_code = 400 | error_code = 400 | ||||
if isinstance(exc, ForbiddenExc): | if isinstance(exc, ForbiddenExc): | ||||
error_code = 403 | error_code = 403 | ||||
if isinstance(exc, NotFoundExc): | if isinstance(exc, NotFoundExc): | ||||
error_code = 404 | error_code = 404 | ||||
return _generate_error_page(request, error_code, error_description) | resp = _generate_error_page(request, error_code, error_description) | ||||
if get_config()["debug"]: | |||||
resp.traceback = error_description | |||||
return resp |