MCPcopy
hub / github.com/cloudflare/cloudflared / checkErrors

Method checkErrors

cfapi/base_client.go:198–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

196}
197
198func (r *response) checkErrors() error {
199 if len(r.Errors) == 0 {
200 return nil
201 }
202 if len(r.Errors) == 1 {
203 return r.Errors[0]
204 }
205 var messagesBuilder strings.Builder
206 for _, e := range r.Errors {
207 messagesBuilder.WriteString(fmt.Sprintf("%s; ", e))
208 }
209 return fmt.Errorf("API errors: %s", messagesBuilder.String())
210}
211
212type apiError struct {
213 Code json.Number `json:"code,omitempty"`

Callers 2

parseResponseEnvelopeFunction · 0.95
statusCodeToErrorMethod · 0.95

Calls 3

WriteStringMethod · 0.80
ErrorfMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected