diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-05-22 13:51:04 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-05-22 13:51:04 +0200 |
commit | ad8f8d97a48f155ba94d5646012e969845a315ab (patch) | |
tree | b991f09b8d08c900dd08583522a7db952ed43c79 /lib/common/error.go | |
parent | fbbcd6cedc47e45f6a2aaae708be194731a0139b (diff) |
Allow to set Syncthing rescanInterval parameter.
Diffstat (limited to 'lib/common/error.go')
-rw-r--r-- | lib/common/error.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/common/error.go b/lib/common/error.go index d03c176..6873d82 100644 --- a/lib/common/error.go +++ b/lib/common/error.go @@ -1,13 +1,16 @@ package common import ( + "fmt" + "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", - "error": err, + "error": errMsg, }) } |