MCPcopy Index your code
hub / github.com/koding/kite / jsonError

Function jsonError

kontrol/http.go:235–243  ·  view source on GitHub ↗

jsonError returns a JSON string of form {"err" : "error content"}

(err error)

Source from the content-addressed store, hash-verified

233
234// jsonError returns a JSON string of form {"err" : "error content"}
235func jsonError(err error) string {
236 var errMsg struct {
237 Err string `json:"err"`
238 }
239 errMsg.Err = err.Error()
240
241 data, _ := json.Marshal(&errMsg)
242 return string(data)
243}

Callers 1

HandleRegisterHTTPMethod · 0.85

Calls 1

ErrorMethod · 0.65

Tested by

no test coverage detected