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

Function ClassifyError

coderd/x/chatd/chatdebug/service.go:661–670  ·  view source on GitHub ↗

ClassifyError maps a run error to the appropriate debug status. nil → StatusCompleted, context.Canceled → StatusInterrupted, everything else → StatusError. Callers with additional classification rules (e.g. ErrInterrupted, ErrDynamicToolCall) should handle those before falling back to this helper.

(err error)

Source from the content-addressed store, hash-verified

659// classification rules (e.g. ErrInterrupted, ErrDynamicToolCall)
660// should handle those before falling back to this helper.
661func ClassifyError(err error) Status {
662 switch {
663 case err == nil:
664 return StatusCompleted
665 case errors.Is(err, context.Canceled):
666 return StatusInterrupted
667 default:
668 return StatusError
669 }
670}
671
672func nullUUID(id uuid.UUID) uuid.NullUUID {
673 return uuid.NullUUID{UUID: id, Valid: id != uuid.Nil}

Callers 5

prepareChatTurnDebugRunFunction · 0.92
TestClassifyErrorFunction · 0.92
startCompactionDebugRunFunction · 0.92

Calls 1

IsMethod · 0.45

Tested by 1

TestClassifyErrorFunction · 0.74