MCPcopy Create free account
hub / github.com/dropbox/dbxcli / collectJSONErrorDetails

Function collectJSONErrorDetails

cmd/output.go:471–489  ·  view source on GitHub ↗
(err error, details map[string]any)

Source from the content-addressed store, hash-verified

469}
470
471func collectJSONErrorDetails(err error, details map[string]any) {
472 if err == nil {
473 return
474 }
475 if detailed, ok := err.(jsonDetailedError); ok {
476 for key, value := range detailed.JSONErrorDetails() {
477 details[key] = value
478 }
479 }
480
481 if joined, ok := err.(interface{ Unwrap() []error }); ok {
482 for _, inner := range joined.Unwrap() {
483 collectJSONErrorDetails(inner, details)
484 }
485 }
486 if wrapped, ok := err.(interface{ Unwrap() error }); ok {
487 collectJSONErrorDetails(wrapped.Unwrap(), details)
488 }
489}
490
491func rateLimitRetryAfterSeconds(err error) (uint64, bool) {
492 var rateLimitErr dropboxauth.RateLimitAPIError

Callers 1

jsonErrorDetailsFunction · 0.85

Calls 2

JSONErrorDetailsMethod · 0.65
UnwrapMethod · 0.45

Tested by

no test coverage detected