phoenix/views/errors.go
2023-11-02 21:50:36 +05:00

18 lines
227 B
Go

package views
import (
"github.com/gin-gonic/gin"
"net/http"
)
func ShowError(ctx *gin.Context, err error) {
ctx.HTML(
http.StatusBadRequest,
"error.html.tmpl",
gin.H{
"error": err.Error(),
},
)
ctx.Abort()
}