Recover
少于1分钟
Recover
Recover middleware for Fiber that recovers from panics anywhere in the stack chain and handles the control to the centralized ErrorHandler.
Fiber 的恢复中间件,可从堆栈链中的任何位置恢复恐慌,并将控制权交给集中的 ErrorHandler。
Signatures 签名
| |
Examples 示例
Import the middleware package that is part of the Fiber web framework
导入 Fiber Web 框架的一部分中间件包
| |
After you initiate your Fiber app, you can use the following possibilities:
在启动 Fiber 应用后,您可以使用以下可能性:
| |
Config 配置
| Property 属性 | Type 输入 | Description 说明 | Default 默认 |
|---|---|---|---|
| Next 下一步 | func(*fiber.Ctx) bool | Next defines a function to skip this middleware when returned true. 接下来定义一个函数,在返回 true 时跳过此中间件。 | nil |
| EnableStackTrace | bool | EnableStackTrace enables handling stack trace. EnableStackTrace 启用堆栈跟踪处理。 | false |
| StackTraceHandler | func(*fiber.Ctx, interface{}) | StackTraceHandler defines a function to handle stack trace. StackTraceHandler 定义一个处理堆栈跟踪的函数。 | defaultStackTraceHandler |
Default Config 默认配置
| |