Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

odezoo.errors

The errors odezoo raises on purpose; the command line prints them without a traceback

OdezooError

Bases: Exception

Base class of every error odezoo raises on purpose

RegistryError

Bases: OdezooError

RegistryError(message: str, *, where: str | None = None, field: str | None = None)

A registry entry, or the registry itself, is not valid

The message names the file (where) and the field it is about, when they are known.

Parameters

message : str
What is wrong
where : str
The file the error is in, such as models/<id>/model.toml
field : str
The field the error is about, such as versions[1].sha256

ModelNotFound

Bases: OdezooError

ModelNotFound(id: str, suggestions: Sequence[str] = ())

No model in the registry has the id asked for

Parameters

id : str
The id that was asked for
suggestions : Sequence[str]
Ids of models with similar names, offered in the message as “did you mean …?”

VersionNotFound

Bases: OdezooError

A model has no version with the id or the format asked for

Attempt

Attempt(source: str, reason: str)

One place a file was looked for, and why it did not give the right bytes

Attributes

source : str
The path or URL that was tried
reason : str
Why it failed, such as sha256 mismatch or HTTP 404

FetchError

Bases: OdezooError

FetchError(model_id: str, version_id: str, attempts: Sequence[Attempt])

No place gave a version’s file with the recorded sha256

Parameters

model_id : str
The model whose file was fetched
version_id : str
The version whose file was fetched
attempts : Sequence[Attempt]
Every place that was tried, in order, and why it failed

OutputExistsError

Bases: OdezooError

OutputExistsError(path: Path)

The file to write exists and holds different bytes

Parameters

path : Path
The file that would have been overwritten