Errors
The Files.com .NET SDK reports errors by throwing exceptions. There are many exception classes defined in the Files SDK that correspond to specific errors.
The raised exceptions come from two categories:
- SDK Exceptions - errors that originate within the SDK
- API Exceptions - errors that occur due to the response from the Files.com API. These errors are grouped into common error types.
Exception class names identify the error type. The exception's Message property provides error details.
Use .NET exception handling to handle errors. Catch specific exception types before SdkException.
SDK Errors
SDK exceptions inherit from SdkException. Invalid SDK usage throws an exception before any request is sent.
Cancellation throws OperationCanceledException. Errors from streams you provide retain the stream's exception type.
SDK Exception Classes
| Exception Class Name | Description |
|---|---|
ApiConnectionException | The Files.com API cannot be reached, or gave no reliable response |
InvalidResponseException | An ApiConnectionException for a response that could not be read, with its httpStatus and httpHeaders when it was an error response |
AuthenticationException | There is no API key or session ID for a request that needs one |
MissingParameterException | A required parameter, or the ID of the object called, is missing |
InvalidParameterException | A passed in parameter or option is invalid, such as a value of the wrong type |
NotImplementedException | The called method has not been implemented by the SDK |
API Errors
API errors are errors returned by the Files.com API. Each exception class inherits from an error group base class. The error group base class indicates a particular type of error.
The class comes from the error type in the response, never from its HTTP status. If the SDK has no class for the returned error type, it throws the error group's exception class, including NotFoundException, or ApiException if the group is unknown. Every API exception
has the response's httpStatus, httpHeaders and error details, such as error and type. Its Message removes URL user information, query strings and fragments from the error text because these can contain signed URL credentials. The error property retains the original text.
API Exception Classes
| Exception Class Name | Error Group |
|---|---|
AgentUpgradeRequiredException | BadRequestException |
AttachmentTooLargeException | BadRequestException |
CannotDownloadDirectoryException | BadRequestException |
CantMoveWithMultipleLocationsException | BadRequestException |
DatetimeParseException | BadRequestException |
DestinationSameException | BadRequestException |
DestinationSiteMismatchException | BadRequestException |
DoesNotSupportSortingException | BadRequestException |
FolderMustNotBeAFileException | BadRequestException |
FoldersNotAllowedException | BadRequestException |
InternalGeneralErrorException | BadRequestException |
InvalidBodyException | BadRequestException |
InvalidCursorException | BadRequestException |
InvalidCursorTypeForSortException | BadRequestException |
InvalidEtagsException | BadRequestException |
InvalidFilterAliasCombinationException | BadRequestException |
InvalidFilterFieldException | BadRequestException |
InvalidFilterParamException | BadRequestException |
InvalidFilterParamFormatException | BadRequestException |
InvalidFilterParamValueException | BadRequestException |
InvalidInputEncodingException | BadRequestException |
InvalidInterfaceException | BadRequestException |
InvalidOauthProviderException | BadRequestException |
InvalidPathException | BadRequestException |
InvalidReturnToUrlException | BadRequestException |
InvalidSearchQueryException | BadRequestException |
InvalidSortFieldException | BadRequestException |
InvalidSortFilterCombinationException | BadRequestException |
InvalidUploadOffsetException | BadRequestException |
InvalidUploadPartGapException | BadRequestException |
InvalidUploadPartSizeException | BadRequestException |
InvalidWorkspaceIdHeaderException | BadRequestException |
MethodNotAllowedException | BadRequestException |
MultipleSortParamsNotAllowedException | BadRequestException |
NoValidInputParamsException | BadRequestException |
OffsetUploadNotAllowedWithMalwareScanningException | BadRequestException |
PartNumberTooLargeException | BadRequestException |
PathCannotHaveTrailingWhitespaceException | BadRequestException |
ReauthenticationNeededFieldsException | BadRequestException |
RequestBodyTooLargeException | BadRequestException |
RequestParamsContainInvalidCharacterException | BadRequestException |
RequestParamsInvalidException | BadRequestException |
RequestParamsRequiredException | BadRequestException |
SearchAllOnChildPathException | BadRequestException |
UnrecognizedSortIndexException | BadRequestException |
UnsupportedCurrencyException | BadRequestException |
UnsupportedHttpResponseFormatException | BadRequestException |
UnsupportedMediaTypeException | BadRequestException |
UserIdInvalidException | BadRequestException |
UserIdOnUserEndpointException | BadRequestException |
UserRequiredException | BadRequestException |
AdditionalAuthenticationRequiredException | NotAuthenticatedException |
ApiKeySessionsNotSupportedException | NotAuthenticatedException |
AuthenticationRequiredException | NotAuthenticatedException |
BundleRegistrationCodeFailedException | NotAuthenticatedException |
InboxRegistrationCodeFailedException | NotAuthenticatedException |
InvalidCredentialsException | NotAuthenticatedException |
InvalidOauthException | NotAuthenticatedException |
InvalidOrExpiredCodeException | NotAuthenticatedException |
InvalidSessionException | NotAuthenticatedException |
InvalidUsernameOrPasswordException | NotAuthenticatedException |
LockedOutException | NotAuthenticatedException |
LockoutRegionMismatchException | NotAuthenticatedException |
OneTimePasswordIncorrectException | NotAuthenticatedException |
TwoFactorAuthenticationErrorException | NotAuthenticatedException |
TwoFactorAuthenticationSetupExpiredException | NotAuthenticatedException |
ApiKeyIsDisabledException | NotAuthorizedException |
ApiKeyIsPathRestrictedException | NotAuthorizedException |
ApiKeyOnlyForDesktopAppException | NotAuthorizedException |
ApiKeyOnlyForFileOperationsException | NotAuthorizedException |
ApiKeyOnlyForMobileAppException | NotAuthorizedException |
ApiKeyOnlyForOfficeIntegrationException | NotAuthorizedException |
BillingInformationHiddenException | NotAuthorizedException |
BillingPermissionRequiredException | NotAuthorizedException |
BundleMaximumUsesReachedException | NotAuthorizedException |
BundlePermissionRequiredException | NotAuthorizedException |
CannotAdministerHigherLevelUserException | NotAuthorizedException |
CannotLoginWhileUsingKeyException | NotAuthorizedException |
CantActForOtherUserException | NotAuthorizedException |
ContactAdminForPasswordChangeHelpException | NotAuthorizedException |
FilesAgentFailedAuthorizationException | NotAuthorizedException |
FolderAdminOrBillingPermissionRequiredException | NotAuthorizedException |
FolderAdminPermissionRequiredException | NotAuthorizedException |
FullPermissionRequiredException | NotAuthorizedException |
HistoryPermissionRequiredException | NotAuthorizedException |
InAppAiAssistantUnavailableException | NotAuthorizedException |
InsufficientPermissionForParamsException | NotAuthorizedException |
InsufficientPermissionForSiteException | NotAuthorizedException |
MoverAccessDeniedException | NotAuthorizedException |
MoverPackageRequiredException | NotAuthorizedException |
MustAuthenticateWithApiKeyException | NotAuthorizedException |
NeedAdminPermissionForInboxException | NotAuthorizedException |
NonAdminsMustQueryByFolderOrPathException | NotAuthorizedException |
NotAllowedToCreateBundleException | NotAuthorizedException |
NotEnqueuableSyncException | NotAuthorizedException |
PasswordChangeNotRequiredException | NotAuthorizedException |
PasswordChangeRequiredException | NotAuthorizedException |
PaymentMethodErrorException | NotAuthorizedException |
PreviewOnlyPermissionCannotDownloadException | NotAuthorizedException |
ReadOnlySessionException | NotAuthorizedException |
ReadPermissionRequiredException | NotAuthorizedException |
ReauthenticationFailedException | NotAuthorizedException |
ReauthenticationFailedFinalException | NotAuthorizedException |
ReauthenticationNeededActionException | NotAuthorizedException |
RecaptchaFailedException | NotAuthorizedException |
RemoteDesktopDebugLoggingDisabledException | NotAuthorizedException |
RootFolderBehaviorSiteAdminRequiredException | NotAuthorizedException |
RootFolderBehaviorSkipSiteAdminRequiredException | NotAuthorizedException |
SelfManagedRequiredException | NotAuthorizedException |
SiteAdminOrPartnerAdminPermissionRequiredException | NotAuthorizedException |
SiteAdminOrWorkspaceAdminOrFolderAdminPermissionRequiredException | NotAuthorizedException |
SiteAdminOrWorkspaceAdminOrPartnerAdminOrFolderAdminPermissionRequiredException | NotAuthorizedException |
SiteAdminOrWorkspaceAdminOrPartnerAdminPermissionRequiredException | NotAuthorizedException |
SiteAdminOrWorkspaceAdminPermissionRequiredException | NotAuthorizedException |
SiteAdminRequiredException | NotAuthorizedException |
SiteFilesAreImmutableException | NotAuthorizedException |
TwoFactorAuthenticationRequiredException | NotAuthorizedException |
UserIdWithoutSiteAdminException | NotAuthorizedException |
WriteAndBundlePermissionRequiredException | NotAuthorizedException |
WritePermissionRequiredException | NotAuthorizedException |
ApiKeyNotFoundException | NotFoundException |
BundlePathNotFoundException | NotFoundException |
BundleRegistrationNotFoundException | NotFoundException |
CodeNotFoundException | NotFoundException |
FileNotFoundException | NotFoundException |
FileUploadNotFoundException | NotFoundException |
GroupNotFoundException | NotFoundException |
InboxNotFoundException | NotFoundException |
NestedNotFoundException | NotFoundException |
PlanNotFoundException | NotFoundException |
SiteNotFoundException | NotFoundException |
UserNotFoundException | NotFoundException |
AgentPushUpdateBlockedException | ProcessingFailureException |
AgentUnavailableException | ProcessingFailureException |
AiTaskCannotBeRunManuallyException | ProcessingFailureException |
AlreadyCompletedException | ProcessingFailureException |
AutomationCannotBeRunManuallyException | ProcessingFailureException |
BehaviorNotAllowedOnRemoteServerException | ProcessingFailureException |
BufferedUploadDisabledForThisDestinationException | ProcessingFailureException |
BundleOnlyAllowsPreviewsException | ProcessingFailureException |
BundleOperationRequiresSubfolderException | ProcessingFailureException |
ConfigurationLockedPathException | ProcessingFailureException |
CouldNotCreateParentException | ProcessingFailureException |
DestinationExistsException | ProcessingFailureException |
DestinationFolderLimitedException | ProcessingFailureException |
DestinationParentConflictException | ProcessingFailureException |
DestinationParentDoesNotExistException | ProcessingFailureException |
ExceededRuntimeLimitException | ProcessingFailureException |
ExpectationAlreadyHasOpenWindowException | ProcessingFailureException |
ExpectationNotManualTriggerException | ProcessingFailureException |
ExpiredPrivateKeyException | ProcessingFailureException |
ExpiredPublicKeyException | ProcessingFailureException |
ExportFailureException | ProcessingFailureException |
ExportNotReadyException | ProcessingFailureException |
FailedToChangePasswordException | ProcessingFailureException |
FileLockedException | ProcessingFailureException |
FileNotUploadedException | ProcessingFailureException |
FilePendingProcessingException | ProcessingFailureException |
FileProcessingErrorException | ProcessingFailureException |
FileTooBigToDecryptException | ProcessingFailureException |
FileTooBigToEncryptException | ProcessingFailureException |
FileUploadedToWrongRegionException | ProcessingFailureException |
FilenameTooLongException | ProcessingFailureException |
FolderLockedException | ProcessingFailureException |
FolderNotEmptyException | ProcessingFailureException |
HistoryUnavailableException | ProcessingFailureException |
InvalidBundleCodeException | ProcessingFailureException |
InvalidFileTypeException | ProcessingFailureException |
InvalidFilenameException | ProcessingFailureException |
InvalidPriorityColorException | ProcessingFailureException |
InvalidRangeException | ProcessingFailureException |
InvalidSiteException | ProcessingFailureException |
InvalidZipFileException | ProcessingFailureException |
MetadataNotSupportedOnRemotesException | ProcessingFailureException |
ModelSaveErrorException | ProcessingFailureException |
MultipleProcessingErrorsException | ProcessingFailureException |
PathTooLongException | ProcessingFailureException |
RecipientAlreadySharedException | ProcessingFailureException |
RemoteEntryReadOnlyException | ProcessingFailureException |
RemoteServerErrorException | ProcessingFailureException |
ResourceBelongsToParentSiteException | ProcessingFailureException |
ResourceLockedException | ProcessingFailureException |
SubfolderLockedException | ProcessingFailureException |
SyncInProgressException | ProcessingFailureException |
TwoFactorAuthenticationCodeAlreadySentException | ProcessingFailureException |
TwoFactorAuthenticationCountryBlacklistedException | ProcessingFailureException |
TwoFactorAuthenticationGeneralErrorException | ProcessingFailureException |
TwoFactorAuthenticationMethodUnsupportedErrorException | ProcessingFailureException |
TwoFactorAuthenticationUnsubscribedRecipientException | ProcessingFailureException |
UpdatesNotAllowedForRemotesException | ProcessingFailureException |
DuplicateShareRecipientException | RateLimitedException |
ReauthenticationRateLimitedException | RateLimitedException |
TooManyConcurrentLoginsException | RateLimitedException |
TooManyConcurrentRequestsException | RateLimitedException |
TooManyLoginAttemptsException | RateLimitedException |
TooManyRequestsException | RateLimitedException |
TooManySharesException | RateLimitedException |
AutomationsUnavailableException | ServiceUnavailableException |
LockOperationBusyException | ServiceUnavailableException |
MigrationInProgressException | ServiceUnavailableException |
SearchUnavailableException | ServiceUnavailableException |
SiteDisabledException | ServiceUnavailableException |
UploadsUnavailableException | ServiceUnavailableException |
AccountAlreadyExistsException | SiteConfigurationException |
AccountOverdueException | SiteConfigurationException |
NoAccountForSiteException | SiteConfigurationException |
SiteWasRemovedException | SiteConfigurationException |
TrialExpiredException | SiteConfigurationException |
TrialLockedException | SiteConfigurationException |
UserRequestsEnabledRequiredException | SiteConfigurationException |