exceptions
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 | |
FileNoIDError
Link
FileNoIDError(fs)
Bases: Exception
No 'id' entry could be found for this file.
Source code in plantdb/commons/fsdb/exceptions.py
109 110 | |
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.
-
Reference API
commons
commons
fsdb
core
Scancreate_fileset
Source code in plantdb/commons/fsdb/exceptions.py
81 82 | |
FilesetNoIDError
Link
FilesetNoIDError(scan)
Bases: Exception
No 'id' entry could be found for this fileset.
Source code in plantdb/commons/fsdb/exceptions.py
102 103 | |
FilesetNotFoundError
Link
FilesetNotFoundError(scan, fs_id)
Bases: Exception
Could not find the fileset directory.
Source code in plantdb/commons/fsdb/exceptions.py
74 75 | |
NoAuthUserError
Link
NoAuthUserError(message=None)
Bases: Exception
Could not get an authenticated user.
-
Reference API
server
server
services
auth
logout_user
Source code in plantdb/commons/fsdb/exceptions.py
120 121 | |
ScanExistsError
Link
ScanExistsError(db, scan_id)
Bases: Exception
Could not find the scan directory.
-
Reference API
commons
commons
fsdb
core
FSDBcreate_scan
Source code in plantdb/commons/fsdb/exceptions.py
67 68 | |
ScanNotFoundError
Link
ScanNotFoundError(db, scan_id)
Bases: Exception
Could not find the scan directory.
Source code in plantdb/commons/fsdb/exceptions.py
60 61 | |