mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +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)
|
||
|
|
}
|
||
|
|
}
|