package util import ( "errors" "github.com/gofiber/fiber/v2" ) func Gofiber_Errorhandler(c *fiber.Ctx, err error) error { code := fiber.StatusInternalServerError var e *fiber.Error if errors.As(err, &e) { code = e.Code } c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8) return c.Status(code).SendString(err.Error()) }