Initial main commit.
[src/xds/xds-server.git] / lib / common / error.go
1 package common
2
3 import (
4         "github.com/gin-gonic/gin"
5 )
6
7 // APIError returns an uniform json formatted error
8 func APIError(c *gin.Context, err string) {
9         c.JSON(500, gin.H{
10                 "status": "error",
11                 "error":  err,
12         })
13 }