Send back an http error code with any plugin errors.
This commit is contained in:
1 parent
610a90c727
commit
482045aed8
1 file changed
+1
@@ -265,6 +265,7 @@ func sendError(w http.ResponseWriter, msg string, code int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func errorResponse(w http.ResponseWriter, fmtString string, item ...interface{}) {
|
func errorResponse(w http.ResponseWriter, fmtString string, item ...interface{}) {
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
json.NewEncoder(w).Encode(map[string]string{
|
json.NewEncoder(w).Encode(map[string]string{
|
||||||
"Err": fmt.Sprintf(fmtString, item...),
|
"Err": fmt.Sprintf(fmtString, item...),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user