The CLI reports this error, and importing it from the settings repository pulled lancedb onto the CLI's import path. Deferring the import into cli() bought nothing, since cli() runs on every invocation: it cost about 1.9 seconds on a cold start, `--help` included. It now sits beside the other store exceptions, in a module that imports nothing, and every importer points there.
29 lines
820 B
Python
29 lines
820 B
Python
class ReadOnlyError(Exception):
|
|
"""Raised when a write operation is attempted on a read-only store."""
|
|
|
|
pass
|
|
|
|
|
|
class ConfigMismatchError(Exception):
|
|
"""Raised when stored config doesn't match current config."""
|
|
|
|
pass
|
|
|
|
|
|
class MigrationRequiredError(Exception):
|
|
"""Database requires migration. Run 'haiku-rag migrate' to upgrade."""
|
|
|
|
pass
|
|
|
|
|
|
class AmbiguousDatabaseError(Exception):
|
|
"""A command that works on one database was run against a configured set."""
|
|
|
|
|
|
class SourceUnavailableError(Exception):
|
|
"""A configured database could not be opened.
|
|
|
|
Carries the configured name and never the location: a path or URI in an
|
|
error message travels into logs and into whatever a consumer renders, and
|
|
the point of naming databases is that locations stay in the configuration.
|
|
"""
|