Skip to content

Exceptions

exceptions

Defines kotobase's exception hierarchy

APIError

Bases: KotobaseError

Common base class for all exceptions coming directly from kotobase's top-level API

These errors indicate that the top-level Kotobase received invalid arguments or had problems using the DTOs produced by the repos

AudioDatabaseNotFoundError

Bases: DatabaseError

Raised when audio bytes are requested, but the optional audio database pack is not installed

DatabaseError

Bases: KotobaseError

Common base class for all exceptions resulting from database management operations

These errors indicate that there has been a problem querying or building the SQLite databases that kotobase relies on

DatabaseExistsError

Bases: DatabaseError

Raised when a build or pull would overwrite a database that already exists and the caller did not request a forced rebuild

DatabaseNotFoundError

Bases: DatabaseError

Raised when a query to the core database is attempted before the database exists

DownloadError

Bases: KotobaseError

Common base class for all exceptions resulting from network downloads

These errors indicate that the upstream data source files, or the pre-built databases couldn't be fetched

KotobaseError

Bases: Exception

Common base class for all exceptions raised by kotobase

MalformedSourceError

Bases: SourceExtractionError

Raised when an upstream source does not follow the format expected by its extractor, indicating that it might be malformed

SourceExtractionError

Bases: KotobaseError

Common base class for all exceptions resulting from upstream source data parsing

These errors indicate that an extractor couldn't produce valid database rows from an upstream data source