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

Function WithClassification

coderd/x/chatd/chaterror/classify.go:102–110  ·  view source on GitHub ↗

WithClassification wraps err so future calls to Classify return classified instead of re-deriving it from err.Error().

(err error, classified ClassifiedError)

Source from the content-addressed store, hash-verified

100// WithClassification wraps err so future calls to Classify return
101// classified instead of re-deriving it from err.Error().
102func WithClassification(err error, classified ClassifiedError) error {
103 if err == nil {
104 return nil
105 }
106 return &classifiedError{
107 cause: err,
108 classified: normalizeClassification(classified),
109 }
110}
111
112type classifiedError struct {
113 cause error

Calls 1

normalizeClassificationFunction · 0.85