MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / Error

Method Error

internal/decision/typesafe.go:110–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108}
109
110func (e *APIError) Error() string {
111 var b strings.Builder
112 fmt.Fprintf(&b, "decision: provider returned %d", e.StatusCode)
113 if e.ErrorType != "" {
114 fmt.Fprintf(&b, " (%s)", e.ErrorType)
115 }
116 fmt.Fprintf(&b, ": %s", e.Body)
117 if e.BodyReadErr != nil {
118 fmt.Fprintf(&b, " [response body read failed partway: %v]", e.BodyReadErr)
119 }
120 return b.String()
121}
122
123// Unwrap exposes a partial-read failure to errors.Is and errors.As, so a
124// caller cancelling mid-read sees errors.Is(err, context.Canceled) rather

Calls 1

StringMethod · 0.45