shorgru/pkg/handler/error.go

15 lines
256 B
Go
Raw Normal View History

package handler
import (
"log"
"github.com/labstack/echo/v4"
"sh.org.ru/pkg/tpl"
)
func ErrorHandler(err error, c echo.Context) {
if err := tpl.ErrorPage(err.Error()).Render(c.Request().Context(), c.Response()); err != nil {
log.Println(err)
}
}