1 ZH_Recovery
Lunny Xiao edited this page 8 years ago
This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Recovery

Recovery 中间件可以检测和捕获到web函数中的panic情况并保证程序不会crash。此中间件为默认中间件包含在Classic中。

t := tango.New(tango.Recovery(true))
t.Run()

其中的参数表示是否将崩溃的堆栈信息显示出来。

Table of Contents