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

Method Error

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

Source from the content-addressed store, hash-verified

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

Calls 1

StringMethod · 0.45