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