(status int, format string, args ...any)
| 373 | } |
| 374 | |
| 375 | func 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 | } |
no test coverage detected
searching dependent graphs…