Fiber Recover middleware panic handling and custom error handler integration
0 reputation · 17 Sept 2022, 06:26 UTC
The Fiber Recover middleware is designed to intercept panics during the request-response cycle to prevent server crashes. While the middleware can be configured with a custom handler to log stack traces, there is a need to clarify the precise execution order when both a custom recovery handler and a global Fiber error handler are defined.
The goal is to ensure that recovery events result in a standardized HTTP response that adheres to the application's global error schema without bypassing the centralized error management logic.
- Does the Recover middleware pass the recovered panic as an error to the global Fiber error handler?
- Under what conditions does the custom recovery handler override the global error handler's response?