1 ZH_Recovery
Lunny Xiao edited this page 2015-04-17 16:17:55 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Recovery

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

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

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