onedrive.exceptions module¶
Package-specific exceptions.
- exception onedrive.exceptions.APIRequestError(msg=None, response=None, request_desc=None, long_format=False)[source]¶
Bases: onedrive.exceptions.GeneralAPIException
An errored API request.
This exception is raised when one gets a response that one cannot handle.
Parameters: msg : str, optional
response : requests.Response, optional
request_desc : str, optional
An optional description of the request which might be used in the message (if msg is not specified), e.g., "metadata request on 'vid'".
long_format : bool, optional
Use long error message, i.e., including request method and URL (if response object is given and contains the request attribute). Default is False.
Attributes
msg (str) response (requests.Response) request_desc (str)
- exception onedrive.exceptions.CopyError(msg=None, src=None, dst=None, response=None, request_desc=None)[source]¶
Bases: onedrive.exceptions.APIRequestError
A special type of APIRequestError for error during copy operation.
Parameters: msg : str, optional
src, dst : str, optional
Source and destination paths.
response : requests.Response, optional
request_desc : str, optional
Attributes
msg (str) path (str) response (requests.Response) request_desc (str)
- exception onedrive.exceptions.CorruptedDownloadError(msg=None, path=None, remote_size=None, local_size=None, remote_sha1sum=None, local_sha1sum=None)[source]¶
Bases: onedrive.exceptions.GeneralOneDriveException
Exception for a corrupted download.
- exception onedrive.exceptions.FileExistsError(msg=None, path=None, type=None, url=None)[source]¶
Bases: onedrive.exceptions.GeneralAPIException
File or directory already exists on OneDrive.
Parameters: msg : str, optional
path : str, optional
Remote path.
type : {None, “file”, “directory”}, optional
url : str, optional
Remote URL.
Attributes
msg (str) path (str) type (str)
- exception onedrive.exceptions.FileNotFoundError(msg=None, path=None, type=None)[source]¶
Bases: onedrive.exceptions.GeneralAPIException
File or directory not found on OneDrive.
Parameters: msg : str, optional
path : str, optional
Remote path.
Attributes
msg (str) path (str) type (str)
- exception onedrive.exceptions.GeneralAPIException(msg=None)[source]¶
Bases: onedrive.exceptions.GeneralOneDriveException
The base execption class for all API related exceptions.
All OneDrive API related exceptions are derived from this class.
- exception onedrive.exceptions.GeneralOneDriveException(msg=None)[source]¶
Bases: builtins.Exception
The base execption class for all package-specific exceptions.
Parameters: msg : str, optional
Error message. If None, the message will be set to "unspecified API exception". Default is None.
Attributes
msg (str)
- exception onedrive.exceptions.IsADirectoryError(msg=None, path=None)[source]¶
Bases: onedrive.exceptions.GeneralAPIException
Requested item is a directory.
Parameters: msg : str, optional
path : str, optional
Remote path.
Attributes
msg (str) path (str)
- exception onedrive.exceptions.NotADirectoryError(msg=None, path=None)[source]¶
Bases: onedrive.exceptions.GeneralAPIException
Requested item is not a directory.
Parameters: msg : str, optional
path : str, optional
Remote path.
Attributes
msg (str) path (str)
- exception onedrive.exceptions.PermissionError(msg=None, path=None)[source]¶
Bases: onedrive.exceptions.GeneralAPIException
Trying to run an operation without the adequate access rights.
Parameters: msg : str, optional
path : str, optional
Remote path.
Attributes
msg (str) path (str)
- exception onedrive.exceptions.UploadError(msg=None, path=None, response=None, request_desc=None, saved_session=None)[source]¶
Bases: onedrive.exceptions.APIRequestError
A special type of APIRequestError for error during uploads.
Parameters: msg : str, optional
path : str, optional
response : requests.Response, optional
request_desc : str, optional
saved_session : onedrive.save.SavedUploadSession
Attributes
msg (str) path (str) response (requests.Response) request_desc (str)