cat_gateway::service::utilities

Module catch_panic

source
Expand description

Handle catching panics created by endpoints, logging them and properly responding.

Structsยง

  • Customized Panic handler. Catches all panics, and turns them into 500. Does not crash the service, BUT will set it to NOT LIVE. Logs the panic as an error. This should cause Kubernetes to restart the service.

Constantsยง

Functionsยง

  • 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.