hubvault.errors

Public exception types for the hubvault package.

This module defines the stable error model exposed by the MVP repository API. Callers are expected to catch these exceptions instead of depending on implementation details from the storage backend.

The module contains:

Example:

>>> from hubvault.errors import RepositoryNotFoundError
>>> err = RepositoryNotFoundError("missing")
>>> str(err)
'missing'

HubVaultError

class hubvault.errors.HubVaultError[source]

Base exception for all hubvault errors.

Example:

>>> err = HubVaultError("boom")
>>> str(err)
'boom'

RepositoryNotFoundError

class hubvault.errors.RepositoryNotFoundError[source]

Raised when a repository root does not contain a valid hubvault repo.

Example:

>>> str(RepositoryNotFoundError("missing"))
'missing'

RepositoryAlreadyExistsError

class hubvault.errors.RepositoryAlreadyExistsError[source]

Raised when repository creation targets an existing or non-empty location.

Example:

>>> str(RepositoryAlreadyExistsError("exists"))
'exists'

RevisionNotFoundError

class hubvault.errors.RevisionNotFoundError[source]

Raised when a branch, tag, or commit identifier cannot be resolved.

Example:

>>> str(RevisionNotFoundError("revision"))
'revision'

EntryNotFoundError

class hubvault.errors.EntryNotFoundError[source]

Raised when a requested logical repo path does not exist in a revision.

Example:

>>> str(EntryNotFoundError("path"))
'path'

ConflictError

class hubvault.errors.ConflictError[source]

Raised when optimistic concurrency checks fail during a write operation.

Example:

>>> str(ConflictError("conflict"))
'conflict'

IntegrityError

class hubvault.errors.IntegrityError[source]

Raised when persisted data does not match its recorded integrity metadata.

Example:

>>> str(IntegrityError("broken"))
'broken'

VerificationError

class hubvault.errors.VerificationError[source]

Raised when a repository fails validation checks.

Example:

>>> str(VerificationError("verify"))
'verify'

HubVaultValidationError

class hubvault.errors.HubVaultValidationError[source]

Raised when a public input fails local repository validation.

This class is the local-name counterpart to the huggingface_hub validation error family while remaining anchored in hubvault.

Example:

>>> isinstance(HubVaultValidationError("bad input"), ValueError)
True

UnsupportedPathError

class hubvault.errors.UnsupportedPathError[source]

Raised when a repo path or ref name violates repository constraints.

Example:

>>> str(UnsupportedPathError("bad path"))
'bad path'