提交 32d9d13d 编写于 作者: V vadimi

Restore SimpleServerError method

上级 7196d6ed
...@@ -13,8 +13,8 @@ var ( ...@@ -13,8 +13,8 @@ var (
VERSION string VERSION string
) )
var tpl = ` var tpl = `
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>beego application error</title> <title>beego application error</title>
...@@ -28,10 +28,10 @@ var tpl = ` ...@@ -28,10 +28,10 @@ var tpl = `
#content .stack pre{padding-left: 10px;} #content .stack pre{padding-left: 10px;}
table {} table {}
td.t {text-align: right; padding-right: 5px; color: #888;} td.t {text-align: right; padding-right: 5px; color: #888;}
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
</script> </script>
</head> </head>
<body> <body>
<div id="header"> <div id="header">
<h2>{{.AppError}}</h2> <h2>{{.AppError}}</h2>
...@@ -58,7 +58,7 @@ var tpl = ` ...@@ -58,7 +58,7 @@ var tpl = `
<p>golang version: {{.GoVersion}}</p> <p>golang version: {{.GoVersion}}</p>
</div> </div>
</body> </body>
</html> </html>
` `
func ShowErr(err interface{}, rw http.ResponseWriter, r *http.Request, Stack string) { func ShowErr(err interface{}, rw http.ResponseWriter, r *http.Request, Stack string) {
...@@ -262,6 +262,10 @@ func InternalServerError(rw http.ResponseWriter, r *http.Request) { ...@@ -262,6 +262,10 @@ func InternalServerError(rw http.ResponseWriter, r *http.Request) {
t.Execute(rw, data) t.Execute(rw, data)
} }
func SimpleServerError(rw http.ResponseWriter, r *http.Request) {
http.Error(rw, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
}
func Errorhandler(err string, h http.HandlerFunc) { func Errorhandler(err string, h http.HandlerFunc) {
ErrorMaps[err] = h ErrorMaps[err] = h
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册