(authErr *dropboxauth.AuthError)
| 597 | } |
| 598 | |
| 599 | func dropboxAuthAPIErrorCode(authErr *dropboxauth.AuthError) string { |
| 600 | if authErr == nil { |
| 601 | return jsonErrorCodeDropboxAPIError |
| 602 | } |
| 603 | switch authErr.Tag { |
| 604 | case dropboxauth.AuthErrorInvalidAccessToken, dropboxauth.AuthErrorExpiredAccessToken: |
| 605 | return jsonErrorCodeAuthRequired |
| 606 | case dropboxauth.AuthErrorInvalidSelectUser, |
| 607 | dropboxauth.AuthErrorInvalidSelectAdmin, |
| 608 | dropboxauth.AuthErrorUserSuspended, |
| 609 | dropboxauth.AuthErrorMissingScope, |
| 610 | dropboxauth.AuthErrorRouteAccessDenied: |
| 611 | return jsonErrorCodePermissionDenied |
| 612 | default: |
| 613 | return jsonErrorCodeDropboxAPIError |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | func dropboxAPIErrorSummary(err error) (string, bool) { |
| 618 | for err != nil { |
no outgoing calls
no test coverage detected