Files
sonr/gateway/handlers/errors.go
T

16 lines
359 B
Go
Raw Normal View History

2024-12-22 17:01:11 -05:00
package handlers
import (
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/gateway/context"
2024-12-22 17:01:11 -05:00
)
// AI! Fix this error handler to only return on 500 errors
2024-12-22 17:01:11 -05:00
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)
}
}