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 -
NotAnFSDBError
for handling invalid database instances - Scan Management -
ScanNotFoundError
for handling missing scan directories - Fileset Operations - Multiple exceptions for fileset-related errors:
FilesetNotFoundError
for missing fileset directoriesFilesetNoIDError
for missing fileset identifiers- File Handling - Specific exceptions for file-related issues:
FileNoIDError
for missing file identifiersFileNoFileNameError
for 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}")
FileNotFoundError Link
FileNotFoundError(fs, f_id)
Bases: Exception
Could not find the file.
Source code in plantdb/commons/fsdb/exceptions.py
54 55 |
|