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

Function NewContextOverflowError

pkg/modelerrors/modelerrors.go:118–124  ·  view source on GitHub ↗

NewContextOverflowError creates a ContextOverflowError wrapping the given underlying error. The Kind is inferred from the underlying error via [classifyOverflow]; if classification yields no result, Kind defaults to [OverflowKindTokens] (the historical behaviour). Use this constructor rather than bu

(underlying error)

Source from the content-addressed store, hash-verified

116// rather than building the struct directly so future field additions don't
117// break callers.
118func NewContextOverflowError(underlying error) *ContextOverflowError {
119 kind := classifyOverflow(underlying)
120 if kind == "" {
121 kind = OverflowKindTokens
122 }
123 return &ContextOverflowError{Underlying: underlying, Kind: kind}
124}
125
126func (e *ContextOverflowError) Error() string {
127 if e.Underlying == nil {

Calls 1

classifyOverflowFunction · 0.85