Skip to content

Exceptions

Every exception raised by pdv inherits from PDVError, so user code can catch all PDV-specific errors in a single clause:

from pdv import PDVError

try:
    pdv_tree['results.bad.path'] = compute()
except PDVError as exc:
    print(f'PDV rejected the write: {exc}')

All exception types are importable from pdv.errors. PDVError itself is also re-exported from the top-level pdv package.


PDVError

Bases: Exception

Base exception for all pdv errors.


PDVPathError

Bases: PDVError

Raised when a path is invalid, escapes the project root, or is otherwise unsafe.


PDVKeyError

Bases: PDVError, KeyError

Raised when a tree path does not exist.


PDVProtectedNameError

Bases: PDVError

Raised when user code attempts to reassign a protected kernel namespace name.


PDVSerializationError

Bases: PDVError

Raised when a value cannot be serialized to or deserialized from disk.


PDVScriptError

Bases: PDVError

Raised when a script fails to load or its run() function raises.


PDVVersionError

Bases: PDVError

Raised when the app's expected protocol version is incompatible with this package.