modify middleware

This commit is contained in:
astaxie
2013-09-11 16:23:41 +08:00
parent 1ff0a31d3f
commit e904d26e08
3 changed files with 5 additions and 61 deletions

View File

@@ -257,7 +257,11 @@ func InternalServerError(rw http.ResponseWriter, r *http.Request) {
t.Execute(rw, data)
}
func registerErrorHander() {
func Errorhandler(err string, h http.HandlerFunc) {
ErrorMaps[err] = h
}
func RegisterErrorHander() {
if _, ok := ErrorMaps["404"]; !ok {
ErrorMaps["404"] = NotFound
}