コード例 #1
0
ファイル: util.go プロジェクト: xianmau/go2o
// 处理自定义错误
func handleCustomError(w http.ResponseWriter, ctx gof.App, err error) {
	if err != nil {
		ctx.Template().Execute(w, gof.TemplateDataMap{
			"error":  err.Error(),
			"statck": template.HTML(strings.Replace(string(debug.Stack()), "\n", "<br />", -1)),
		},
			"views/shop/ols/{device}/error.html")
	}
}