Exception Types#
labapi exposes a small set of public exception classes at the top level so
callers can reliably catch failures by category.
Public Exception Hierarchy#
All custom exceptions inherit from LabArchivesError:
Exception
`-- LabArchivesError
|-- AuthenticationError
|-- ApiError
|-- NodeExistsError
`-- TraversalError
Import and catch these from labapi:
from labapi import LabArchivesError, NodeExistsError, NotebookPage, TraversalError
try:
page = notebook.create(NotebookPage, "Experiments/2024/Results")
except NodeExistsError:
...
except ValueError:
...
except TraversalError:
...
except LabArchivesError:
...
Common Operations and Raised Exceptions#
create()Raises
NodeExistsErrorwhen creating a duplicate node withif_exists=InsertBehavior.Raise.Raises
ValueErrorwhen creating a multi-segment path withoutparents=Trueand an intermediate parent is missing.traverse()Raises
TraversalErrorwhen an intermediate path segment exists but is not a directory.