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

Function jsonErrorDetails

cmd/output.go:440–461  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

438}
439
440func jsonErrorDetails(err error) map[string]any {
441 details := make(map[string]any)
442
443 collectJSONErrorDetails(err, details)
444
445 if retryAfterSeconds, ok := rateLimitRetryAfterSeconds(err); ok {
446 details["retry_after_seconds"] = retryAfterSeconds
447 }
448 if summary, ok := dropboxAPIErrorSummary(err); ok {
449 details["api_summary"] = summary
450 } else if summary, ok := dropboxAPISummaryFromMessage(err.Error()); ok {
451 details["api_summary"] = summary
452 }
453 if endpoint, ok := dropboxAPIEndpointFromMessage(err.Error()); ok {
454 details["api_endpoint"] = endpoint
455 }
456
457 if len(details) == 0 {
458 return nil
459 }
460 return details
461}
462
463func jsonErrorDetailsForCommand(cmd *cobra.Command, err error) map[string]any {
464 details := jsonErrorDetails(err)

Calls 6

collectJSONErrorDetailsFunction · 0.85
dropboxAPIErrorSummaryFunction · 0.85
ErrorMethod · 0.45