From badac3a123f87168e1da077b7fba06b4e2f9ce4b Mon Sep 17 00:00:00 2001 From: feistel <6742251-feistel@users.noreply.gitlab.com> Date: Mon, 27 Jun 2022 10:27:04 +0200 Subject: Do not log an error when serving 404 in routing middleware --- internal/routing/middleware.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/routing') diff --git a/internal/routing/middleware.go b/internal/routing/middleware.go index 8272635a..1b15f55c 100644 --- a/internal/routing/middleware.go +++ b/internal/routing/middleware.go @@ -20,13 +20,13 @@ func NewMiddleware(handler http.Handler, s source.Source) http.Handler { // middleware chain and simply respond with 502 after logging this d, err := getDomain(r, s) if err != nil && !errors.Is(err, domain.ErrDomainDoesNotExist) { - logging.LogRequest(r).WithError(err).Error("could not fetch domain information from a source") - if errors.Is(err, context.Canceled) { httperrors.Serve404(w) return } + logging.LogRequest(r).WithError(err).Error("could not fetch domain information from a source") + httperrors.Serve502(w) return } -- cgit v1.2.3