我以前使用过 J2EE,可以将此配置添加到web.xml
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error</location>
</error-page>
上面代码的效果是,如果抛出了一个未处理的异常,它会被传递给/error
页面,并显示给用户。
当我的 Go web 应用程序在 Google App Engine 上出现恐慌时,有没有办法做类似的事情?