Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Allow to set Syncthing rescanInterval parameter.
[src/xds/xds-server.git]
/
lib
/
common
/
error.go
diff --git
a/lib/common/error.go
b/lib/common/error.go
index
d03c176
..
6873d82
100644
(file)
--- a/
lib/common/error.go
+++ b/
lib/common/error.go
@@
-1,13
+1,16
@@
package common
import (
package common
import (
+ "fmt"
+
"github.com/gin-gonic/gin"
)
// APIError returns an uniform json formatted error
"github.com/gin-gonic/gin"
)
// APIError returns an uniform json formatted error
-func APIError(c *gin.Context, err string) {
+func APIError(c *gin.Context, format string, args ...interface{}) {
+ errMsg := fmt.Sprintf(format, args...)
c.JSON(500, gin.H{
"status": "error",
c.JSON(500, gin.H{
"status": "error",
- "error": err,
+ "error": err
Msg
,
})
}
})
}