Code Review
/
src
/
xds
/
xds-server.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
history
|
raw
|
HEAD
Auto detect XDS-Agent tarballs and fix URL.
[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
}