exceptions
plantdb.commons.fsdb.exceptions Link
Custom FSDB ExceptionsLink
A collection of specialized exception classes designed to handle various error scenarios in a file system database (FSDB) implementation. These exceptions provide clear, specific error handling for database operations, scan management, and fileset manipulations.
Key FeaturesLink
- Database Validation
NotAnFSDBErrorfor invalid database instances- Scan Management : exceptions for scan-related errors:
ScanExistsErrorfor existing scan directoriesScanNotFoundErrorfor missing scan directories- Fileset Operations: exceptions for fileset-related errors:
FilesetExistsErrorfor existing fileset directoriesFilesetNotFoundErrorfor missing fileset directoriesFilesetNoIDErrorfor missing fileset identifiers- File Handling: exceptions for file-related issues:
FileExistsErrorfor existing fileFileNotFoundErrorfor missing fileFileNoIDErrorfor missing file identifiersFileNoFileNameErrorfor missing file names
Usage ExamplesLink
# Example of handling scan-related errors
try:
scan = db.get_scan("non_existent_scan")
except ScanNotFoundError as e:
print(f"Error: {e}")
# Example of handling fileset errors
try:
fileset = scan.get_fileset("invalid_fileset")
except FilesetNotFoundError as e:
print(f"Error: {e}")
FileExistsError Link
FileExistsError(fs, f_id)
Bases: Exception
The file already exists.
Source code in plantdb/commons/fsdb/exceptions.py
95 96 | |
FileNotFoundError Link
FileNotFoundError(fs, f_id)
Bases: Exception
Could not find the file.
Source code in plantdb/commons/fsdb/exceptions.py
88 89 | |
FilesetExistsError Link
FilesetExistsError(scan, fs_id)
Bases: Exception
The fileset directory already exists.
Source code in plantdb/commons/fsdb/exceptions.py
81 82 | |
FilesetNotFoundError Link
FilesetNotFoundError(scan, fs_id)
Bases: Exception
Could not find the fileset directory.
Source code in plantdb/commons/fsdb/exceptions.py
74 75 | |