1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 09:30:56 +00:00

Restore SimpleServerError method

This commit is contained in:
vadimi 2013-12-06 00:44:54 -05:00
parent 7196d6ede3
commit 32d9d13dc7

View File

@ -13,8 +13,8 @@ var (
VERSION string
)
var tpl = `
<!DOCTYPE html>
<html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>beego application error</title>
@ -28,10 +28,10 @@ var tpl = `
#content .stack pre{padding-left: 10px;}
table {}
td.t {text-align: right; padding-right: 5px; color: #888;}
</style>
</style>
<script type="text/javascript">
</script>
</head>
</head>
<body>
<div id="header">
<h2>{{.AppError}}</h2>
@ -58,7 +58,7 @@ var tpl = `
<p>golang version: {{.GoVersion}}</p>
</div>
</body>
</html>
</html>
`
func ShowErr(err interface{}, rw http.ResponseWriter, r *http.Request, Stack string) {
@ -262,6 +262,10 @@ func InternalServerError(rw http.ResponseWriter, r *http.Request) {
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) {
ErrorMaps[err] = h
}