From d155921ab3b621badce029bcd40d7eb3ec46c3437d87ac2b7019fc218c576472 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Tue, 9 Jul 2024 23:52:28 +0200 Subject: [PATCH] . --- bots-common/listen.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bots-common/listen.go b/bots-common/listen.go index ef89322..0342def 100644 --- a/bots-common/listen.go +++ b/bots-common/listen.go @@ -62,6 +62,12 @@ func StartServerWithAddress(listenDefs ListenDefinitions, addr string) { return } + if h.HasError() { + h.LogError("error in parser %s: %v", reqType, h.Error) + res.WriteHeader(http.StatusInternalServerError) + return + } + if err := handler(h); err != nil { h.LogError("error in handler for %s: %v", reqType, err) res.WriteHeader(http.StatusInternalServerError)