maestral.errorhandling¶
This module contains methods and decorators to convert OSErrors and Dropbox SDK
exceptions to instances of maestral.exceptions.MaestralApiError
.
Module Contents¶
- maestral.errorhandling.convert_api_errors(dbx_path=None, local_path=None)[source]¶
A context manager that catches and re-raises instances of
OSError
anddropbox.exceptions.DropboxException
asmaestral.exceptions.MaestralApiError
orConnectionError
.
- maestral.errorhandling.os_to_maestral_error(exc, dbx_path=None, local_path=None)[source]¶
Converts a
OSError
to amaestral.exceptions.MaestralApiError
and tries to add a reasonably informative error title and message.
- maestral.errorhandling.dropbox_to_maestral_error(exc, dbx_path=None, local_path=None)[source]¶
Converts a Dropbox SDK exception to a
maestral.exceptions.MaestralApiError
and tries to add a reasonably informative error title and message.- Parameters:
exc (dropbox.exceptions.DropboxException | dropbox.stone_validators.ValidationError | requests.HTTPError) – Dropbox SDK exception..
dbx_path (str | None) – Dropbox path associated with the error.
local_path (str | None) – Local path associated with the error.
- Returns:
Converted exception.
- Return type: