package utils

import (
	"log"

	"github.com/gin-gonic/gin"
)

func JSONErr(c *gin.Context, status int, msg string) {
	c.AbortWithStatusJSON(status, gin.H{
		"status": status,
		"error":  msg,
	})
}

func JSONErrPriv(c *gin.Context, status int, err error) {
	log.Println(err)
	JSONErr(c, status, "server error")
}
