Errors
The Files.com Go SDK will return errors from function/method calls using the standard Go error handling pattern.
The returned errors fall into basic categories:
error- errors that originate in the SDK or standard libraries.ResponseError- errors that occur due to the response from the Files.com API.
The error type are errors that implement the type error interface and the error specifics can be accessed with the Error() method.
ResponseError also implements the type error interface but is a custom error with additional data.
The additional data includes:
Type- the type of error returned by the Files.com APITitle- a description of the error returned by the Files.com APIErrorMessage- additional error information
ResponseError Types
ResponseError errors have additional data returned from the Files.com API to help determine the cause of the error.
| Type | Go Error | Title |
|---|---|---|
bad-request | ErrBadRequest | Bad Request |
bad-request/agent-upgrade-required | ErrAgentUpgradeRequired | Agent Upgrade Required |
bad-request/attachment-too-large | ErrAttachmentTooLarge | Attachment Too Large |
bad-request/cannot-download-directory | ErrCannotDownloadDirectory | Cannot Download Directory |
bad-request/cant-move-with-multiple-locations | ErrCantMoveWithMultipleLocations | Cant Move With Multiple Locations |
bad-request/datetime-parse | ErrDatetimeParse | Datetime Parse |
bad-request/destination-same | ErrDestinationSame | Destination Same |
bad-request/destination-site-mismatch | ErrDestinationSiteMismatch | Destination Site Mismatch |
bad-request/does-not-support-sorting | ErrDoesNotSupportSorting | Does Not Support Sorting |
bad-request/folder-must-not-be-a-file | ErrFolderMustNotBeAFile | Folder Must Not Be A File |
bad-request/folders-not-allowed | ErrFoldersNotAllowed | Folders Not Allowed |
bad-request/internal-general-error | ErrInternalGeneralError | Internal General Error |
bad-request/invalid-body | ErrInvalidBody | Invalid Body |
bad-request/invalid-cursor | ErrInvalidCursor | Invalid Cursor |
bad-request/invalid-cursor-type-for-sort | ErrInvalidCursorTypeForSort | Invalid Cursor Type For Sort |
bad-request/invalid-etags | ErrInvalidEtags | Invalid Etags |
bad-request/invalid-filter-alias-combination | ErrInvalidFilterAliasCombination | Invalid Filter Alias Combination |
bad-request/invalid-filter-field | ErrInvalidFilterField | Invalid Filter Field |
bad-request/invalid-filter-param | ErrInvalidFilterParam | Invalid Filter Param |
bad-request/invalid-filter-param-format | ErrInvalidFilterParamFormat | Invalid Filter Param Format |
bad-request/invalid-filter-param-value | ErrInvalidFilterParamValue | Invalid Filter Param Value |
bad-request/invalid-input-encoding | ErrInvalidInputEncoding | Invalid Input Encoding |
bad-request/invalid-interface | ErrInvalidInterface | Invalid Interface |
bad-request/invalid-oauth-provider | ErrInvalidOauthProvider | Invalid Oauth Provider |
bad-request/invalid-path | ErrInvalidPath | Invalid Path |
bad-request/invalid-return-to-url | ErrInvalidReturnToUrl | Invalid Return To Url |
bad-request/invalid-search-query | ErrInvalidSearchQuery | Invalid Search Query |
bad-request/invalid-sort-field | ErrInvalidSortField | Invalid Sort Field |
bad-request/invalid-sort-filter-combination | ErrInvalidSortFilterCombination | Invalid Sort Filter Combination |
bad-request/invalid-upload-offset | ErrInvalidUploadOffset | Invalid Upload Offset |
bad-request/invalid-upload-part-gap | ErrInvalidUploadPartGap | Invalid Upload Part Gap |
bad-request/invalid-upload-part-size | ErrInvalidUploadPartSize | Invalid Upload Part Size |
bad-request/invalid-workspace-id-header | ErrInvalidWorkspaceIdHeader | Invalid Workspace Id Header |
bad-request/method-not-allowed | ErrMethodNotAllowed | Method Not Allowed |
bad-request/multiple-sort-params-not-allowed | ErrMultipleSortParamsNotAllowed | Multiple Sort Params Not Allowed |
bad-request/no-valid-input-params | ErrNoValidInputParams | No Valid Input Params |
bad-request/offset-upload-not-allowed-with-malware-scanning | ErrOffsetUploadNotAllowedWithMalwareScanning | Offset Upload Not Allowed With Malware Scanning |
bad-request/part-number-too-large | ErrPartNumberTooLarge | Part Number Too Large |
bad-request/path-cannot-have-trailing-whitespace | ErrPathCannotHaveTrailingWhitespace | Path Cannot Have Trailing Whitespace |
bad-request/reauthentication-needed-fields | ErrReauthenticationNeededFields | Reauthentication Needed Fields |
bad-request/request-body-too-large | ErrRequestBodyTooLarge | Request Body Too Large |
bad-request/request-params-contain-invalid-character | ErrRequestParamsContainInvalidCharacter | Request Params Contain Invalid Character |
bad-request/request-params-invalid | ErrRequestParamsInvalid | Request Params Invalid |
bad-request/request-params-required | ErrRequestParamsRequired | Request Params Required |
bad-request/search-all-on-child-path | ErrSearchAllOnChildPath | Search All On Child Path |
bad-request/unrecognized-sort-index | ErrUnrecognizedSortIndex | Unrecognized Sort Index |
bad-request/unsupported-currency | ErrUnsupportedCurrency | Unsupported Currency |
bad-request/unsupported-http-response-format | ErrUnsupportedHttpResponseFormat | Unsupported Http Response Format |
bad-request/unsupported-media-type | ErrUnsupportedMediaType | Unsupported Media Type |
bad-request/user-id-invalid | ErrUserIdInvalid | User Id Invalid |
bad-request/user-id-on-user-endpoint | ErrUserIdOnUserEndpoint | User Id On User Endpoint |
bad-request/user-required | ErrUserRequired | User Required |
not-authenticated/additional-authentication-required | ErrAdditionalAuthenticationRequired | Additional Authentication Required |
not-authenticated/api-key-sessions-not-supported | ErrApiKeySessionsNotSupported | Api Key Sessions Not Supported |
not-authenticated/authentication-required | ErrAuthenticationRequired | Authentication Required |
not-authenticated/bundle-registration-code-failed | ErrBundleRegistrationCodeFailed | Bundle Registration Code Failed |
not-authenticated/files-agent-token-failed | ErrFilesAgentTokenFailed | Files Agent Token Failed |
not-authenticated/inbox-registration-code-failed | ErrInboxRegistrationCodeFailed | Inbox Registration Code Failed |
not-authenticated/invalid-credentials | ErrInvalidCredentials | Invalid Credentials |
not-authenticated/invalid-oauth | ErrInvalidOauth | Invalid Oauth |
not-authenticated/invalid-or-expired-code | ErrInvalidOrExpiredCode | Invalid Or Expired Code |
not-authenticated/invalid-session | ErrInvalidSession | Invalid Session |
not-authenticated/invalid-username-or-password | ErrInvalidUsernameOrPassword | Invalid Username Or Password |
not-authenticated/locked-out | ErrLockedOut | Locked Out |
not-authenticated/lockout-region-mismatch | ErrLockoutRegionMismatch | Lockout Region Mismatch |
not-authenticated/one-time-password-incorrect | ErrOneTimePasswordIncorrect | One Time Password Incorrect |
not-authenticated/two-factor-authentication-error | ErrTwoFactorAuthenticationError | Two Factor Authentication Error |
not-authenticated/two-factor-authentication-setup-expired | ErrTwoFactorAuthenticationSetupExpired | Two Factor Authentication Setup Expired |
not-authorized/api-key-is-disabled | ErrApiKeyIsDisabled | Api Key Is Disabled |
not-authorized/api-key-is-path-restricted | ErrApiKeyIsPathRestricted | Api Key Is Path Restricted |
not-authorized/api-key-only-for-desktop-app | ErrApiKeyOnlyForDesktopApp | Api Key Only For Desktop App |
not-authorized/api-key-only-for-mobile-app | ErrApiKeyOnlyForMobileApp | Api Key Only For Mobile App |
not-authorized/api-key-only-for-office-integration | ErrApiKeyOnlyForOfficeIntegration | Api Key Only For Office Integration |
not-authorized/billing-information-hidden | ErrBillingInformationHidden | Billing Information Hidden |
not-authorized/billing-permission-required | ErrBillingPermissionRequired | Billing Permission Required |
not-authorized/bundle-maximum-uses-reached | ErrBundleMaximumUsesReached | Bundle Maximum Uses Reached |
not-authorized/bundle-permission-required | ErrBundlePermissionRequired | Bundle Permission Required |
not-authorized/cannot-login-while-using-key | ErrCannotLoginWhileUsingKey | Cannot Login While Using Key |
not-authorized/cant-act-for-other-user | ErrCantActForOtherUser | Cant Act For Other User |
not-authorized/contact-admin-for-password-change-help | ErrContactAdminForPasswordChangeHelp | Contact Admin For Password Change Help |
not-authorized/files-agent-failed-authorization | ErrFilesAgentFailedAuthorization | Files Agent Failed Authorization |
not-authorized/folder-admin-or-billing-permission-required | ErrFolderAdminOrBillingPermissionRequired | Folder Admin Or Billing Permission Required |
not-authorized/folder-admin-permission-required | ErrFolderAdminPermissionRequired | Folder Admin Permission Required |
not-authorized/full-permission-required | ErrFullPermissionRequired | Full Permission Required |
not-authorized/history-permission-required | ErrHistoryPermissionRequired | History Permission Required |
not-authorized/in-app-ai-assistant-unavailable | ErrInAppAiAssistantUnavailable | In App Ai Assistant Unavailable |
not-authorized/insufficient-permission-for-params | ErrInsufficientPermissionForParams | Insufficient Permission For Params |
not-authorized/insufficient-permission-for-site | ErrInsufficientPermissionForSite | Insufficient Permission For Site |
not-authorized/mover-access-denied | ErrMoverAccessDenied | Mover Access Denied |
not-authorized/mover-package-required | ErrMoverPackageRequired | Mover Package Required |
not-authorized/must-authenticate-with-api-key | ErrMustAuthenticateWithApiKey | Must Authenticate With Api Key |
not-authorized/need-admin-permission-for-inbox | ErrNeedAdminPermissionForInbox | Need Admin Permission For Inbox |
not-authorized/non-admins-must-query-by-folder-or-path | ErrNonAdminsMustQueryByFolderOrPath | Non Admins Must Query By Folder Or Path |
not-authorized/not-allowed-to-create-bundle | ErrNotAllowedToCreateBundle | Not Allowed To Create Bundle |
not-authorized/not-enqueuable-sync | ErrNotEnqueuableSync | Not Enqueuable Sync |
not-authorized/password-change-not-required | ErrPasswordChangeNotRequired | Password Change Not Required |
not-authorized/password-change-required | ErrPasswordChangeRequired | Password Change Required |
not-authorized/payment-method-error | ErrPaymentMethodError | Payment Method Error |
not-authorized/preview-only-permission-cannot-download | ErrPreviewOnlyPermissionCannotDownload | Preview Only Permission Cannot Download |
not-authorized/read-only-session | ErrReadOnlySession | Read Only Session |
not-authorized/read-permission-required | ErrReadPermissionRequired | Read Permission Required |
not-authorized/reauthentication-failed | ErrReauthenticationFailed | Reauthentication Failed |
not-authorized/reauthentication-failed-final | ErrReauthenticationFailedFinal | Reauthentication Failed Final |
not-authorized/reauthentication-needed-action | ErrReauthenticationNeededAction | Reauthentication Needed Action |
not-authorized/recaptcha-failed | ErrRecaptchaFailed | Recaptcha Failed |
not-authorized/remote-desktop-debug-logging-disabled | ErrRemoteDesktopDebugLoggingDisabled | Remote Desktop Debug Logging Disabled |
not-authorized/root-folder-behavior-site-admin-required | ErrRootFolderBehaviorSiteAdminRequired | Root Folder Behavior Site Admin Required |
not-authorized/root-folder-behavior-skip-site-admin-required | ErrRootFolderBehaviorSkipSiteAdminRequired | Root Folder Behavior Skip Site Admin Required |
not-authorized/self-managed-required | ErrSelfManagedRequired | Self Managed Required |
not-authorized/site-admin-or-partner-admin-permission-required | ErrSiteAdminOrPartnerAdminPermissionRequired | Site Admin Or Partner Admin Permission Required |
not-authorized/site-admin-or-workspace-admin-or-folder-admin-permission-required | ErrSiteAdminOrWorkspaceAdminOrFolderAdminPermissionRequired | Site Admin Or Workspace Admin Or Folder Admin Permission Required |
not-authorized/site-admin-or-workspace-admin-or-partner-admin-or-folder-admin-permission-required | ErrSiteAdminOrWorkspaceAdminOrPartnerAdminOrFolderAdminPermissionRequired | Site Admin Or Workspace Admin Or Partner Admin Or Folder Admin Permission Required |
not-authorized/site-admin-or-workspace-admin-or-partner-admin-permission-required | ErrSiteAdminOrWorkspaceAdminOrPartnerAdminPermissionRequired | Site Admin Or Workspace Admin Or Partner Admin Permission Required |
not-authorized/site-admin-or-workspace-admin-permission-required | ErrSiteAdminOrWorkspaceAdminPermissionRequired | Site Admin Or Workspace Admin Permission Required |
not-authorized/site-admin-required | ErrSiteAdminRequired | Site Admin Required |
not-authorized/site-files-are-immutable | ErrSiteFilesAreImmutable | Site Files Are Immutable |
not-authorized/two-factor-authentication-required | ErrTwoFactorAuthenticationRequired | Two Factor Authentication Required |
not-authorized/user-id-without-site-admin | ErrUserIdWithoutSiteAdmin | User Id Without Site Admin |
not-authorized/write-and-bundle-permission-required | ErrWriteAndBundlePermissionRequired | Write And Bundle Permission Required |
not-authorized/write-permission-required | ErrWritePermissionRequired | Write Permission Required |
not-found | ErrNotFound | Not Found |
not-found/api-key-not-found | ErrApiKeyNotFound | Api Key Not Found |
not-found/bundle-path-not-found | ErrBundlePathNotFound | Bundle Path Not Found |
not-found/bundle-registration-not-found | ErrBundleRegistrationNotFound | Bundle Registration Not Found |
not-found/code-not-found | ErrCodeNotFound | Code Not Found |
not-found/file-not-found | ErrFileNotFound | File Not Found |
not-found/file-upload-not-found | ErrFileUploadNotFound | File Upload Not Found |
not-found/group-not-found | ErrGroupNotFound | Group Not Found |
not-found/inbox-not-found | ErrInboxNotFound | Inbox Not Found |
not-found/nested-not-found | ErrNestedNotFound | Nested Not Found |
not-found/plan-not-found | ErrPlanNotFound | Plan Not Found |
not-found/site-not-found | ErrSiteNotFound | Site Not Found |
not-found/user-not-found | ErrUserNotFound | User Not Found |
processing-failure | ErrProcessingFailure | Processing Failure |
processing-failure/agent-push-update-blocked | ErrAgentPushUpdateBlocked | Agent Push Update Blocked |
processing-failure/agent-unavailable | ErrAgentUnavailable | Agent Unavailable |
processing-failure/ai-task-cannot-be-run-manually | ErrAiTaskCannotBeRunManually | Ai Task Cannot Be Run Manually |
processing-failure/already-completed | ErrAlreadyCompleted | Already Completed |
processing-failure/automation-cannot-be-run-manually | ErrAutomationCannotBeRunManually | Automation Cannot Be Run Manually |
processing-failure/behavior-not-allowed-on-remote-server | ErrBehaviorNotAllowedOnRemoteServer | Behavior Not Allowed On Remote Server |
processing-failure/buffered-upload-disabled-for-this-destination | ErrBufferedUploadDisabledForThisDestination | Buffered Upload Disabled For This Destination |
processing-failure/bundle-only-allows-previews | ErrBundleOnlyAllowsPreviews | Bundle Only Allows Previews |
processing-failure/bundle-operation-requires-subfolder | ErrBundleOperationRequiresSubfolder | Bundle Operation Requires Subfolder |
processing-failure/configuration-locked-path | ErrConfigurationLockedPath | Configuration Locked Path |
processing-failure/could-not-create-parent | ErrCouldNotCreateParent | Could Not Create Parent |
processing-failure/destination-exists | ErrDestinationExists | Destination Exists |
processing-failure/destination-folder-limited | ErrDestinationFolderLimited | Destination Folder Limited |
processing-failure/destination-parent-conflict | ErrDestinationParentConflict | Destination Parent Conflict |
processing-failure/destination-parent-does-not-exist | ErrDestinationParentDoesNotExist | Destination Parent Does Not Exist |
processing-failure/exceeded-runtime-limit | ErrExceededRuntimeLimit | Exceeded Runtime Limit |
processing-failure/expectation-already-has-open-window | ErrExpectationAlreadyHasOpenWindow | Expectation Already Has Open Window |
processing-failure/expectation-not-manual-trigger | ErrExpectationNotManualTrigger | Expectation Not Manual Trigger |
processing-failure/expired-private-key | ErrExpiredPrivateKey | Expired Private Key |
processing-failure/expired-public-key | ErrExpiredPublicKey | Expired Public Key |
processing-failure/export-failure | ErrExportFailure | Export Failure |
processing-failure/export-not-ready | ErrExportNotReady | Export Not Ready |
processing-failure/failed-to-change-password | ErrFailedToChangePassword | Failed To Change Password |
processing-failure/file-locked | ErrFileLocked | File Locked |
processing-failure/file-not-uploaded | ErrFileNotUploaded | File Not Uploaded |
processing-failure/file-pending-processing | ErrFilePendingProcessing | File Pending Processing |
processing-failure/file-processing-error | ErrFileProcessingError | File Processing Error |
processing-failure/file-too-big-to-decrypt | ErrFileTooBigToDecrypt | File Too Big To Decrypt |
processing-failure/file-too-big-to-encrypt | ErrFileTooBigToEncrypt | File Too Big To Encrypt |
processing-failure/file-uploaded-to-wrong-region | ErrFileUploadedToWrongRegion | File Uploaded To Wrong Region |
processing-failure/filename-too-long | ErrFilenameTooLong | Filename Too Long |
processing-failure/folder-locked | ErrFolderLocked | Folder Locked |
processing-failure/folder-not-empty | ErrFolderNotEmpty | Folder Not Empty |
processing-failure/history-unavailable | ErrHistoryUnavailable | History Unavailable |
processing-failure/invalid-bundle-code | ErrInvalidBundleCode | Invalid Bundle Code |
processing-failure/invalid-file-type | ErrInvalidFileType | Invalid File Type |
processing-failure/invalid-filename | ErrInvalidFilename | Invalid Filename |
processing-failure/invalid-priority-color | ErrInvalidPriorityColor | Invalid Priority Color |
processing-failure/invalid-range | ErrInvalidRange | Invalid Range |
processing-failure/invalid-site | ErrInvalidSite | Invalid Site |
processing-failure/invalid-zip-file | ErrInvalidZipFile | Invalid Zip File |
processing-failure/metadata-not-supported-on-remotes | ErrMetadataNotSupportedOnRemotes | Metadata Not Supported On Remotes |
processing-failure/model-save-error | ErrModelSaveError | Model Save Error |
processing-failure/multiple-processing-errors | ErrMultipleProcessingErrors | Multiple Processing Errors |
processing-failure/path-too-long | ErrPathTooLong | Path Too Long |
processing-failure/recipient-already-shared | ErrRecipientAlreadyShared | Recipient Already Shared |
processing-failure/remote-server-error | ErrRemoteServerError | Remote Server Error |
processing-failure/resource-belongs-to-parent-site | ErrResourceBelongsToParentSite | Resource Belongs To Parent Site |
processing-failure/resource-locked | ErrResourceLocked | Resource Locked |
processing-failure/subfolder-locked | ErrSubfolderLocked | Subfolder Locked |
processing-failure/sync-in-progress | ErrSyncInProgress | Sync In Progress |
processing-failure/two-factor-authentication-code-already-sent | ErrTwoFactorAuthenticationCodeAlreadySent | Two Factor Authentication Code Already Sent |
processing-failure/two-factor-authentication-country-blacklisted | ErrTwoFactorAuthenticationCountryBlacklisted | Two Factor Authentication Country Blacklisted |
processing-failure/two-factor-authentication-general-error | ErrTwoFactorAuthenticationGeneralError | Two Factor Authentication General Error |
processing-failure/two-factor-authentication-method-unsupported-error | ErrTwoFactorAuthenticationMethodUnsupportedError | Two Factor Authentication Method Unsupported Error |
processing-failure/two-factor-authentication-unsubscribed-recipient | ErrTwoFactorAuthenticationUnsubscribedRecipient | Two Factor Authentication Unsubscribed Recipient |
processing-failure/updates-not-allowed-for-remotes | ErrUpdatesNotAllowedForRemotes | Updates Not Allowed For Remotes |
rate-limited/duplicate-share-recipient | ErrDuplicateShareRecipient | Duplicate Share Recipient |
rate-limited/reauthentication-rate-limited | ErrReauthenticationRateLimited | Reauthentication Rate Limited |
rate-limited/too-many-concurrent-logins | ErrTooManyConcurrentLogins | Too Many Concurrent Logins |
rate-limited/too-many-concurrent-requests | ErrTooManyConcurrentRequests | Too Many Concurrent Requests |
rate-limited/too-many-login-attempts | ErrTooManyLoginAttempts | Too Many Login Attempts |
rate-limited/too-many-requests | ErrTooManyRequests | Too Many Requests |
rate-limited/too-many-shares | ErrTooManyShares | Too Many Shares |
service-unavailable/automations-unavailable | ErrAutomationsUnavailable | Automations Unavailable |
service-unavailable/migration-in-progress | ErrMigrationInProgress | Migration In Progress |
service-unavailable/site-disabled | ErrSiteDisabled | Site Disabled |
service-unavailable/uploads-unavailable | ErrUploadsUnavailable | Uploads Unavailable |
site-configuration/account-already-exists | ErrAccountAlreadyExists | Account Already Exists |
site-configuration/account-overdue | ErrAccountOverdue | Account Overdue |
site-configuration/no-account-for-site | ErrNoAccountForSite | No Account For Site |
site-configuration/site-was-removed | ErrSiteWasRemoved | Site Was Removed |
site-configuration/trial-expired | ErrTrialExpired | Trial Expired |
site-configuration/trial-locked | ErrTrialLocked | Trial Locked |
site-configuration/user-requests-enabled-required | ErrUserRequestsEnabledRequired | User Requests Enabled Required |
ResponseError Helpers
Helpers are provided for matching error families.
| Error Type Prefix | Go Error | Helper |
|---|---|---|
bad-request | ErrBadRequest | IsBadRequest |
not-authenticated | ErrNotAuthenticated | IsAuthenticationError |
not-authorized | ErrNotAuthorized | IsAuthorizationError |
not-found | ErrNotFound | IsNotFound |
processing-failure | ErrProcessingFailure | IsProcessingFailure |
rate-limited | ErrRateLimited | IsRateLimited |
service-unavailable | ErrServiceUnavailable | IsServiceUnavailable |
site-configuration | ErrSiteConfiguration | IsSiteConfiguration |