package handler import ( "log" "github.com/gofiber/fiber/v2" ) const ( defaultErrMessage = "couldn't process request" ) func JSONError(c *fiber.Ctx, status int, err error, message string) error { if err != nil { log.Printf("JSONError: %s\n", err) } return c.Status(status).SendString("error: " + message) }