MCPcopy
hub / github.com/netdata/netdata / writeFunctionError

Function writeFunctionError

src/go/cmd/godplugin/main.go:375–387  ·  view source on GitHub ↗
(status int, format string, args ...any)

Source from the content-addressed store, hash-verified

373}
374
375func writeFunctionError(status int, format string, args ...any) {
376 resp := map[string]any{
377 "status": status,
378 "errorMessage": fmt.Sprintf(format, args...),
379 }
380 data, err := json.Marshal(resp)
381 if err != nil {
382 _, _ = fmt.Fprintf(os.Stdout, "{\"status\":%d,\"errorMessage\":\"%s\"}\n", status, "failed to encode error response")
383 return
384 }
385 _, _ = os.Stdout.Write(data)
386 _, _ = os.Stdout.Write([]byte("\n"))
387}

Callers 1

runFunctionCLIFunction · 0.85

Calls 1

WriteMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…