phoenix/views/errors.go

15 lines
285 B
Go
Raw Normal View History

2023-04-06 10:36:11 +05:00
package views
import (
"github.com/gin-gonic/gin"
2023-11-01 23:18:33 +05:00
"github.com/ordinary-dev/phoenix/config"
2023-04-06 10:36:11 +05:00
"net/http"
)
2023-11-01 23:18:33 +05:00
func ShowError(ctx *gin.Context, cfg *config.Config, err error) {
Render(ctx, cfg, http.StatusBadRequest, "error.html.tmpl", gin.H{
"error": err.Error(),
})
2023-11-01 22:40:15 +05:00
ctx.Abort()
2023-04-06 10:36:11 +05:00
}