aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/handler/error.go')
-rw-r--r--pkg/handler/error.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/handler/error.go b/pkg/handler/error.go
new file mode 100644
index 0000000..f74be59
--- /dev/null
+++ b/pkg/handler/error.go
@@ -0,0 +1,14 @@
+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)
+ }
+}