MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / internalerror

Function internalerror

openlibrary/plugins/openlibrary/code.py:1032–1060  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1030
1031
1032def internalerror():
1033 name_webpy_error = save_error()
1034
1035 exception_type, exception_value, _ = sys.exc_info()
1036
1037 # TODO: move this stats stuff to plugins\openlibrary\stats.py
1038 # Can't have sub-metrics, so can't add more info
1039 openlibrary.core.stats.increment("ol.internal-errors")
1040 increment_error_count("ol.internal-errors-segmented")
1041
1042 # TODO: move this to plugins\openlibrary\sentry.py
1043 from openlibrary.plugins.openlibrary.sentry import sentry
1044
1045 sentry_event_id: str | None = None
1046 if sentry.enabled:
1047 sentry_event_id = sentry.capture_exception_webpy()
1048
1049 if features.is_enabled("debug"):
1050 raise web.debugerror()
1051 else:
1052 msg = render.site(
1053 render.internalerror(
1054 name_webpy_error,
1055 sentry_event_id,
1056 etype=exception_type,
1057 evalue=exception_value,
1058 )
1059 )
1060 raise web.internalerror(web.safestr(msg))
1061
1062
1063delegate.app.internalerror = internalerror

Callers

nothing calls this directly

Calls 4

increment_error_countFunction · 0.90
save_errorFunction · 0.70
is_enabledMethod · 0.45

Tested by

no test coverage detected