MCPcopy Create free account
hub / github.com/cloudflare/cfssl / NewErrorResponse

Function NewErrorResponse

api/api.go:203–210  ·  view source on GitHub ↗

NewErrorResponse is a shortcut for creating an error response for a single error.

(message string, code int)

Source from the content-addressed store, hash-verified

201// NewErrorResponse is a shortcut for creating an error response for a
202// single error.
203func NewErrorResponse(message string, code int) Response {
204 return Response{
205 Success: false,
206 Result: nil,
207 Errors: []ResponseMessage{{code, message}},
208 Messages: []ResponseMessage{},
209 }
210}
211
212// SendResponse builds a response from the result, sets the JSON
213// header, and writes to the http.ResponseWriter.

Callers 2

failFunction · 0.92
HandleErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…