Code Review
/
src
/
xds
/
xds-server.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
6873d8231330b8e16410403f203e77212ba6c576
[src/xds/xds-server.git]
/
lib
/
common
/
error.go
1
package common
2
3
import (
4
"fmt"
5
6
"github.com/gin-gonic/gin"
7
)
8
9
// APIError returns an uniform json formatted error
10
func APIError(c *gin.Context, format string, args ...interface{}) {
11
errMsg := fmt.Sprintf(format, args...)
12
c.JSON(500, gin.H{
13
"status": "error",
14
"error": errMsg,
15
})
16
}