Allow to set Syncthing rescanInterval parameter.
[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 }