feat(config): add PanicHandler to Config for custom recovery

This commit is contained in:
Hein
2026-06-30 13:49:51 +02:00
parent 3f86eb0f06
commit d648614611
2 changed files with 20 additions and 2 deletions
+4
View File
@@ -42,6 +42,10 @@ type Config struct {
// AutoTLSEmail is the email for Let's Encrypt registration (optional but recommended)
AutoTLSEmail string
// PanicHandler is called when a request handler panics.
// If nil, the default middleware.PanicRecovery is used (logs, records metric, returns 500).
PanicHandler func(w http.ResponseWriter, r *http.Request, rcv any)
// Graceful shutdown configuration
// ShutdownTimeout is the maximum time to wait for graceful shutdown
// Default: 30 seconds