diff options
| author | Bobby <[email protected]> | 2025-12-22 12:41:27 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-12-22 12:41:27 +0530 |
| commit | f17d9142781eb1a659ea53311d9225b244ad209c (patch) | |
| tree | 1b03e1f96cca8559ad1a7e37e74279136a3bf157 /controllers | |
| parent | ed74f2cffa902a3e9aeb614f8dcf65f04658a597 (diff) | |
| download | lain-f17d9142781eb1a659ea53311d9225b244ad209c.tar.xz lain-f17d9142781eb1a659ea53311d9225b244ad209c.zip | |
better auth and error handler setup
Diffstat (limited to 'controllers')
| -rw-r--r-- | controllers/errors.go | 9 |
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, |
