Request Method: | {{.RequestMethod}} | -
Request URL: | {{.RequestURL}} | -
RemoteAddr: | {{.RemoteAddr }} | -
{{.Stack}}-
diff --git a/beego.go b/beego.go index 6acf4ac1..55049090 100644 --- a/beego.go +++ b/beego.go @@ -1,6 +1,7 @@ package beego import ( + "github.com/astaxie/beego/middleware" "github.com/astaxie/beego/session" "net/http" "path" @@ -25,7 +26,7 @@ func AutoRouter(c ControllerInterface) *App { } func Errorhandler(err string, h http.HandlerFunc) *App { - ErrorMaps[err] = h + middleware.Errorhandler(err, h) return BeeApp } @@ -78,6 +79,10 @@ func Run() { } } } - registerErrorHander() + + middleware.VERSION = VERSION + middleware.AppName = AppName + middleware.RegisterErrorHander() + BeeApp.Run() } diff --git a/errors.go b/errors.go deleted file mode 100644 index 45ce9114..00000000 --- a/errors.go +++ /dev/null @@ -1,280 +0,0 @@ -package beego - -import ( - "fmt" - "html/template" - "net/http" - "runtime" -) - -var tpl = ` - - -
- -Request Method: | {{.RequestMethod}} | -
Request URL: | {{.RequestURL}} | -
RemoteAddr: | {{.RemoteAddr }} | -
{{.Stack}}-