From d198086dd439ca8721048a7dbfdef8f14af38b03 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 4 Apr 2020 16:03:12 +0200 Subject: [PATCH] fix http error handlers --- server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.go b/server.go index 12a3fc6..dbc2074 100644 --- a/server.go +++ b/server.go @@ -18,14 +18,14 @@ func (server Server) ServeHTTP(res http.ResponseWriter, req *http.Request) { // 1. find a matching service in the config service := server.conf.Find(req) if service == nil { - errorHandler(api.ErrorUnknownService) + errorHandler(api.ErrorUnknownService).ServeHTTP(res, req) return } // 2. extract request data dataset, err := extractRequestData(service, *req) if err != nil { - errorHandler(api.ErrorMissingParam) + errorHandler(api.ErrorMissingParam).ServeHTTP(res, req) return } @@ -39,7 +39,7 @@ func (server Server) ServeHTTP(res http.ResponseWriter, req *http.Request) { // 4. fail if found no handler if handler == nil { - errorHandler(api.ErrorUncallableService) + errorHandler(api.ErrorUncallableService).ServeHTTP(res, req) return }