Skip to content

Commit b316b93

Browse files
author
Armin
committed
add recovery middleware to Echo server for improved error handling
1 parent 2c392bf commit b316b93

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/app.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
_ "github.com/go-sql-driver/mysql"
1414
"github.com/labstack/echo/v4"
15+
"github.com/labstack/echo/v4/middleware"
1516
)
1617

1718
var (
@@ -96,6 +97,7 @@ func initEcho() {
9697
}
9798
})
9899
Echo.Use(metrics.EchoMiddleware())
100+
Echo.Use(middleware.Recover())
99101
}
100102

101103
func Shutdown() {

0 commit comments

Comments
 (0)