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

Function errorResult

coderd/x/chatd/chattool/execute.go:356–365  ·  view source on GitHub ↗

errorResult builds a ToolResponse from an ExecuteResult with an error message.

(msg string)

Source from the content-addressed store, hash-verified

354// errorResult builds a ToolResponse from an ExecuteResult with
355// an error message.
356func errorResult(msg string) fantasy.ToolResponse {
357 data, err := json.Marshal(ExecuteResult{
358 Success: false,
359 Error: msg,
360 })
361 if err != nil {
362 return fantasy.NewTextErrorResponse(msg)
363 }
364 return fantasy.NewTextResponse(string(data))
365}
366
367// detectFileDump checks whether the command matches a file-dump
368// pattern and returns an advisory note, or empty string if no

Callers 5

executeBackgroundFunction · 0.70
executeForegroundFunction · 0.70
ProcessOutputFunction · 0.70
ProcessListFunction · 0.70
ProcessSignalFunction · 0.70

Calls 1

MarshalMethod · 0.45

Tested by

no test coverage detected