mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 21:09:11 +00:00
15 lines
304 B
Go
15 lines
304 B
Go
|
package handlers
|
||
|
|
||
|
import (
|
||
|
"github.com/labstack/echo/v4"
|
||
|
"github.com/onsonr/sonr/app/gateway/context"
|
||
|
)
|
||
|
|
||
|
func ErrorHandler(err error, c echo.Context) {
|
||
|
if he, ok := err.(*echo.HTTPError); ok {
|
||
|
// Log the error if needed
|
||
|
c.Logger().Errorf("Error: %v", he.Message)
|
||
|
context.RenderError(c, he)
|
||
|
}
|
||
|
}
|