MCPcopy Index your code
hub / github.com/coder/coder / fakeAgentAPITaskLogsErr

Function fakeAgentAPITaskLogsErr

cli/task_logs_test.go:292–302  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

290}
291
292func fakeAgentAPITaskLogsErr(err error) map[string]http.HandlerFunc {
293 return map[string]http.HandlerFunc{
294 "/messages": func(w http.ResponseWriter, r *http.Request) {
295 w.WriteHeader(http.StatusInternalServerError)
296 w.Header().Set("Content-Type", "application/json")
297 _ = json.NewEncoder(w).Encode(map[string]interface{}{
298 "error": err.Error(),
299 })
300 },
301 }
302}

Callers 1

Test_TaskLogs_GoldenFunction · 0.85

Calls 5

EncodeMethod · 0.80
SetMethod · 0.65
WriteHeaderMethod · 0.45
HeaderMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected