diff --git a/middleware/error.go b/middleware/error.go index 566b658a..d154a09b 100644 --- a/middleware/error.go +++ b/middleware/error.go @@ -13,8 +13,8 @@ var ( VERSION string ) var tpl = ` - - + + beego application error @@ -28,10 +28,10 @@ var tpl = ` #content .stack pre{padding-left: 10px;} table {} td.t {text-align: right; padding-right: 5px; color: #888;} - + - + - + ` 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 }