MCPcopy
hub / github.com/docker/compose / errorAsJSON

Function errorAsJSON

cmd/compose/compose.go:197–208  ·  view source on GitHub ↗
(message string)

Source from the content-addressed store, hash-verified

195}
196
197func errorAsJSON(message string) string {
198 errorMessage := &jsonErrorData{
199 Error: true,
200 Message: message,
201 }
202 marshal, err := json.Marshal(errorMessage)
203 if err == nil {
204 return string(marshal)
205 } else {
206 return message
207 }
208}
209
210func makeJSONError(err error) error {
211 if err == nil {

Callers 1

makeJSONErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected