MCPcopy Index your code
hub / github.com/docker/docker-agent / classifyModelCallError

Function classifyModelCallError

pkg/rag/strategy/indexing_errors.go:23–37  ·  view source on GitHub ↗

classifyModelCallError inspects an error returned by an embedding or LLM call made during indexing. Permanent failures are wrapped with errIndexingAborted so callers can abort the run; transient failures (5xx, timeouts) and context cancellation are returned unchanged so callers can skip the current

(err error)

Source from the content-addressed store, hash-verified

21// timeouts) and context cancellation are returned unchanged so callers can
22// skip the current file and continue.
23func classifyModelCallError(err error) error {
24 if err == nil {
25 return nil
26 }
27 if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
28 return err
29 }
30 // Rate-limited (429) errors are also non-retryable here: continuing to
31 // index would keep hammering a provider that asked us to back off.
32 retryable, _, _ := modelerrors.ClassifyModelError(err)
33 if !retryable {
34 return fmt.Errorf("%w: %w", errIndexingAborted, err)
35 }
36 return err
37}
38
39// isIndexingAborted reports whether err carries the errIndexingAborted marker.
40func isIndexingAborted(err error) bool {

Callers 3

indexFileMethod · 0.85
buildEmbeddingInputsMethod · 0.85

Calls 1

ClassifyModelErrorFunction · 0.92

Tested by 1