Exceptions
Exceptions relating to file operations.
Exceptions:
|
Exception raised for file errors. |
|
Exception raised for unrecognised file types. |
|
Exception raised when a file cannot be found. |
|
Exception raised when a path is invalid. |
|
Exception raised for errors in loading an image. |
- exception musify.file.exception.FileError(file=None, message=None)
Bases:
MusifyError
Exception raised for file errors.
- Parameters:
file (
str
|Path
|None
(default:None
)) – The file type that caused the error.message (
str
|None
(default:None
)) – Explanation of the error.
- exception musify.file.exception.InvalidFileType(filetype, message='File type not recognised')
Bases:
FileError
Exception raised for unrecognised file types.
- Parameters:
filetype (
str
) – The file type that caused the error.message (
str
(default:'File type not recognised'
)) – Explanation of the error.
- exception musify.file.exception.FileDoesNotExistError(path, message='File cannot be found')
Bases:
FileError
,FileNotFoundError
Exception raised when a file cannot be found.
- Parameters:
path (
str
|Path
) – The path that caused the error.message (
str
(default:'File cannot be found'
)) – Explanation of the error.
- exception musify.file.exception.UnexpectedPathError(path, message='Invalid path given')
Bases:
FileError
Exception raised when a path is invalid. Usually raised when a directory is given when a file was expected and vice versa.
- Parameters:
path (
str
|Path
) – The path that caused the error.message (
str
(default:'Invalid path given'
)) – Explanation of the error.