Module catch_panic

Module catch_panic 

Source
Expand description

A middleware to catch and log panics.

Structsยง

CatchPanicEndpoint
An endpoint for the CatchPanicMiddleware middleware.
CatchPanicMiddleware
A middleware for catching and logging panics transforming them to the 500 error response. The panic will not crash the service, but it becomes not live after exceeding the Settings::service_live_counter_threshold() value. That should cause Kubernetes to restart the service.

Constantsยง

BACKTRACE ๐Ÿ”’
LOCATION ๐Ÿ”’

Functionsยง

panic_response ๐Ÿ”’
Converts a panic to a response.
set_panic_hook ๐Ÿ”’
Sets a custom panic hook to capture the Backtrace and Panic Location for logging purposes. This hook gets called BEFORE we catch it. So the thread local variables stored here are valid when processing the panic capture.