From c368b3e77031c2017db3c8b167e194c25ed51295 Mon Sep 17 00:00:00 2001 From: Jamie Tanna Date: Fri, 25 Apr 2025 10:22:45 +0100 Subject: [PATCH] fix: correct error code This error path shouldn't be happening very often, but we should still correct the error code used. --- oapi_validate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oapi_validate.go b/oapi_validate.go index 10d552f..78cf122 100644 --- a/oapi_validate.go +++ b/oapi_validate.go @@ -211,7 +211,7 @@ func performRequestValidationForErrorHandlerWithOpts(next http.Handler, w http.R // we don't want to crash the server, so handle the unexpected error. // return http.StatusInternalServerError, theErr = fmt.Errorf("error validating route: %w", e) - errOpts.StatusCode = http.StatusUnauthorized + errOpts.StatusCode = http.StatusInternalServerError } options.ErrorHandlerWithOpts(r.Context(), theErr, w, r, errOpts)