maestral.errors

This module defines Maestral’s error classes. It should be kept free of memory heavy imports.

All errors inherit from MaestralApiError which has title and message attributes to display the error to the user. Errors which are related to syncing a specific file or folder inherit from SyncError, a subclass of MaestralApiError.

Module Contents

exception maestral.errors.MaestralApiError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: Exception

Base class for Maestral errors

MaestralApiError provides attributes that can be used to generate human-readable error messages and metadata regarding affected file paths (if any).

Errors originating from the Dropbox API or the ‘local API’ both inherit from MaestralApiError.

Parameters
  • title – A short description of the error type. This can be used in a CLI or GUI to give a short error summary.

  • message – A more verbose description which can include instructions on how to proceed to fix the error.

  • dbx_path – Dropbox path of the file that caused the error.

  • dbx_path_dst – Dropbox destination path of the file that caused the error. This should be set for instance when error occurs when moving an item.

  • local_path – Local path of the file that caused the error.

  • local_path_dst – Local destination path of the file that caused the error. This should be set for instance when error occurs when moving an item.

exception maestral.errors.SyncError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Base class for recoverable sync issues.

exception maestral.errors.InsufficientPermissionsError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when accessing a file or folder fails due to insufficient permissions, both locally and on Dropbox servers.

exception maestral.errors.InsufficientSpaceError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when the Dropbox account or local drive has insufficient storage space.

exception maestral.errors.PathError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when there is an issue with the provided file or folder path such as invalid characters, a too long file name, etc.

exception maestral.errors.NotFoundError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when a file or folder is requested but does not exist.

exception maestral.errors.ConflictError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when trying to create a file or folder which already exists.

exception maestral.errors.FileConflictError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.ConflictError

Raised when trying to create a file which already exists.

exception maestral.errors.FolderConflictError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when trying to create or folder which already exists.

exception maestral.errors.IsAFolderError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when a file is required but a folder is provided.

exception maestral.errors.NotAFolderError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when a folder is required but a file is provided.

exception maestral.errors.DropboxServerError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised in case of internal Dropbox errors.

exception maestral.errors.RestrictedContentError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when trying to sync restricted content, for instance when adding a file with a DMCA takedown notice to a public folder.

exception maestral.errors.UnsupportedFileError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when this file type cannot be downloaded but only exported. This is the case for G-suite files.

exception maestral.errors.FileSizeError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when attempting to upload a file larger than 350 GB in an upload session or larger than 150 MB in a single upload. Also raised when attempting to download a file with a size that exceeds file system’s limit.

exception maestral.errors.FileReadError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.SyncError

Raised when reading a local file failed.

exception maestral.errors.DropboxConnectionError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when the connection to Dropbox fails

exception maestral.errors.CancelledError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when syncing is cancelled by the user.

exception maestral.errors.NotLinkedError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when no Dropbox account is linked.

exception maestral.errors.InvalidDbidError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when the given Dropbox ID does not correspond to an existing account.

exception maestral.errors.KeyringAccessError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when retrieving a saved auth token from the user keyring fails.

exception maestral.errors.NoDropboxDirError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when the local Dropbox folder cannot be found.

exception maestral.errors.CacheDirError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when creating the cache directory fails.

exception maestral.errors.InotifyError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when the local Dropbox folder is too large to monitor with inotify.

exception maestral.errors.OutOfMemoryError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when there is insufficient memory to complete an operation.

exception maestral.errors.DatabaseError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when reading or writing to the database fails.

exception maestral.errors.DropboxAuthError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when authentication fails.

exception maestral.errors.TokenExpiredError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.DropboxAuthError

Raised when authentication fails because the user’s token has expired.

exception maestral.errors.TokenRevokedError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.DropboxAuthError

Raised when authentication fails because the user’s token has been revoked.

exception maestral.errors.CursorResetError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when the cursor used for a longpoll or list-folder request has been invalidated. Dropbox will very rarely invalidate a cursor. If this happens, a new cursor for the respective folder has to be obtained through files_list_folder. This may require re-syncing the entire Dropbox.

exception maestral.errors.BadInputError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when an API request is made with bad input. This should not happen during syncing but only in case of manual API calls.

exception maestral.errors.BusyError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when trying to perform an action which is only possible in the idle state and we cannot block or queue the job.

exception maestral.errors.UnsupportedFileTypeForDiff(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when a diff for an unsupported file type was issued.

exception maestral.errors.SharedLinkError(title: str, message: str = '', dbx_path: Optional[str] = None, dbx_path_dst: Optional[str] = None, local_path: Optional[str] = None, local_path_dst: Optional[str] = None)[source]

Bases: maestral.errors.MaestralApiError

Raised when creating a shared link fails.