From de20960458ad557cc555a30c49626266e4de709b Mon Sep 17 00:00:00 2001 From: JessonChan Date: Thu, 17 Sep 2015 10:36:29 +0800 Subject: [PATCH] error map refactor --- hooks.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hooks.go b/hooks.go index 7223bd19..6e401c06 100644 --- a/hooks.go +++ b/hooks.go @@ -33,7 +33,9 @@ func registerDefaultErrorHandler() error { "503": serviceUnavailable, "504": gatewayTimeout, } { - ErrorHandler(e, h) + if _, ok := ErrorMaps[e]; !ok { + ErrorHandler(e, h) + } } return nil }