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
111 112 | |
FileNoIDError
Link
FileNoIDError(fs)
Bases: Exception
No 'id' entry could be found for this file.
Source code in plantdb/commons/fsdb/exceptions.py
125 126 | |
FileNotFoundError
Link
FileNotFoundError(fs, f_id)
Bases: Exception
Could not find the file.
Source code in plantdb/commons/fsdb/exceptions.py
104 105 | |
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
97 98 | |
FilesetNoIDError
Link
FilesetNoIDError(scan)
Bases: Exception
No 'id' entry could be found for this fileset.
Source code in plantdb/commons/fsdb/exceptions.py
118 119 | |
FilesetNotFoundError
Link
FilesetNotFoundError(scan, fs_id)
Bases: Exception
Could not find the fileset directory.
Source code in plantdb/commons/fsdb/exceptions.py
90 91 | |
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
136 137 | |
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
69 70 | |
ScanNotFoundError
Link
ScanNotFoundError(db, scan_id)
Bases: Exception
Could not find the scan directory.
Source code in plantdb/commons/fsdb/exceptions.py
62 63 | |
TimeLapseExistsError
Link
TimeLapseExistsError(db, tl_id)
Bases: Exception
The timelapse directory already exists.
Source code in plantdb/commons/fsdb/exceptions.py
83 84 | |
TimeLapseNotFoundError
Link
TimeLapseNotFoundError(db, tl_id)
Bases: Exception
Could not find the timelapse directory.
Source code in plantdb/commons/fsdb/exceptions.py
76 77 | |