mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-03-03 15:40:00 -05:00
auth/transcoder: fix tripple responses on errors (#1261)
This commit is contained in:
parent
98ea631978
commit
fefcc5b124
@ -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
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user