summaryrefslogtreecommitdiffstats
path: root/lib/common/error.go
blob: d03c176613fcabcd5559df3b632cc80ac9c83591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package common

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

// APIError returns an uniform json formatted error
func APIError(c *gin.Context, err string) {
	c.JSON(500, gin.H{
		"status": "error",
		"error":  err,
	})
}