add initial application structure with configuration, logging, and health check endpoints
This commit is contained in:
14
internal/exception/handler.go
Normal file
14
internal/exception/handler.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package exception
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func RegisterErrorHandler(e *echo.Echo) {
|
||||
e.HTTPErrorHandler = func(err error, c echo.Context) {
|
||||
_ = c.JSON(500, map[string]any{
|
||||
"code": "INTERNAL_ERROR",
|
||||
"message": err.Error(),
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user