Documentation
¶
Overview ¶
Package recovery provides panic recovery middleware for HTTP handlers.
The middleware recovers from panics in HTTP handlers and returns a 500 Internal Server Error response to the client. This prevents a single panicking request from crashing the entire server.
Basic Usage ¶
mux := http.NewServeMux()
mux.HandleFunc("/", handler)
wrappedMux := recovery.Middleware(mux)
http.ListenAndServe(":8080", wrappedMux)
Stability ¶
This package is Beta stability. The API may have minor changes before reaching stable status in v1.0.0.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
Middleware is an HTTP middleware that recovers from panics. When a panic occurs, it returns a 500 Internal Server Error response to the client, preventing the panic from crashing the server.
TODO(#7): Add configurable logging support once common logging is established across ToolHive. Currently panics are silently recovered.
Types ¶
This section is empty.