diff --git a/e2core/server/server.go b/e2core/server/server.go index f3fc450d..2ec27d92 100644 --- a/e2core/server/server.go +++ b/e2core/server/server.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" "github.com/pkg/errors" "github.com/rs/zerolog" "go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho" @@ -58,6 +59,7 @@ func New(l zerolog.Logger, sync *syncer.Syncer, opts *options.Options) (*Server, e.Use( mid.UUIDRequestID(), otelecho.Middleware("e2core"), + middleware.Recover(), ) d := newDispatcher(ll, b.Connect()) diff --git a/e2core/sourceserver/bundle.go b/e2core/sourceserver/bundle.go index 567e0e38..a9fd874b 100644 --- a/e2core/sourceserver/bundle.go +++ b/e2core/sourceserver/bundle.go @@ -5,6 +5,7 @@ import ( "os" "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" "github.com/pkg/errors" "github.com/rs/zerolog" @@ -30,6 +31,7 @@ func FromBundle(bundlePath string) (*echo.Echo, error) { e.Use( mid.UUIDRequestID(), mid.Logger(l, nil), + middleware.Recover(), ) rt := NewRouter(l, bs) diff --git a/sat/sat/sat.go b/sat/sat/sat.go index 7ba8d70f..834d4cb1 100644 --- a/sat/sat/sat.go +++ b/sat/sat/sat.go @@ -9,6 +9,7 @@ import ( "time" "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" "github.com/pkg/errors" "github.com/rs/zerolog" "go.opentelemetry.io/otel/trace" @@ -73,6 +74,9 @@ func New(config *Config, logger zerolog.Logger, traceProvider trace.TracerProvid } sat.server = echo.New() + sat.server.Use( + middleware.Recover(), + ) sat.server.HTTPErrorHandler = kitError.Handler(logger) sat.server.HideBanner = true