auth/transcoder: fix tripple responses on errors (#1261)

This commit is contained in:
acelinkio
2026-01-10 01:40:07 -08:00
committed by GitHub
parent 98ea631978
commit fefcc5b124
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -31,6 +31,12 @@ import (
)
func ErrorHandler(err error, c echo.Context) {
// otelecho & RequestLoggerWithConfig middleware call c.Error
// otelecho docs: https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho#WithOnError
if c.Response().Committed {
return
}
code := http.StatusInternalServerError
var message string
+6
View File
@@ -27,6 +27,12 @@ import (
)
func ErrorHandler(err error, c echo.Context) {
// otelecho & RequestLoggerWithConfig middleware call c.Error
// otelecho docs: https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho#WithOnError
if c.Response().Committed {
return
}
code := http.StatusInternalServerError
var message string
if he, ok := err.(*echo.HTTPError); ok {