summaryrefslogtreecommitdiff
path: root/controllers/errors.go
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-12-22 12:41:27 +0530
committerBobby <[email protected]>2025-12-22 12:41:27 +0530
commitf17d9142781eb1a659ea53311d9225b244ad209c (patch)
tree1b03e1f96cca8559ad1a7e37e74279136a3bf157 /controllers/errors.go
parented74f2cffa902a3e9aeb614f8dcf65f04658a597 (diff)
downloadlain-f17d9142781eb1a659ea53311d9225b244ad209c.tar.xz
lain-f17d9142781eb1a659ea53311d9225b244ad209c.zip
better auth and error handler setup
Diffstat (limited to 'controllers/errors.go')
-rw-r--r--controllers/errors.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/controllers/errors.go b/controllers/errors.go
index 019083a..8af9b22 100644
--- a/controllers/errors.go
+++ b/controllers/errors.go
@@ -16,6 +16,15 @@ func BadRequest(context *fiber.Ctx, err error) error {
})
}
+func DefaultError(context *fiber.Ctx, err error) error {
+ return shortcuts.RenderError(types.TemplateError{
+ Context: context,
+ PageTitle: "Error",
+ ErrorMessage: shortcuts.BuildErrorMessage(err, "An error occurred while processing your request."),
+ StatusCode: fiber.StatusInternalServerError,
+ })
+}
+
func Forbidden(context *fiber.Ctx, err error) error {
return shortcuts.RenderError(types.TemplateError{
Context: context,