fluree.errors

Exceptions raised by Fluree.

Every error derives from FlureeError. Where a Python builtin exception means the same thing, the Fluree error derives from it too, so except LookupError catches a missing ledger and except ValueError catches a malformed query.

Module Contents

exception fluree.errors.FlureeError

Bases: Exception

Base class for all Fluree errors.

status is the HTTP-style status code the engine assigned the error, or None when the error did not come from the engine.

status: int | None = None
exception fluree.errors.InvalidRequestError

Bases: FlureeError, ValueError

The query, transaction, or argument is malformed or invalid.

exception fluree.errors.ShaclViolationError

Bases: InvalidRequestError

A write that would leave data breaking the ledger’s SHACL shapes.

violations lists each way it would, as the same ValidationResult objects validate reports, so a rejected write is handled like a failed validation.

property violations: list[ValidationResult]

Each way the write breaks the shapes, as ValidationResult objects.

exception fluree.errors.UniqueConstraintError

Bases: InvalidRequestError

A write that would give two subjects the same value of a property the ledger requires to be unique (f:enforceUnique).

value is the value as text; graph is the named graph’s IRI, or None for the default graph.

property: IRI
value: str
graph: IRI | None
existing_subject: IRI
new_subject: IRI
exception fluree.errors.NotFoundError

Bases: FlureeError, LookupError

A ledger, branch, commit, or graph does not exist.

exception fluree.errors.PermissionDeniedError

Bases: FlureeError, PermissionError

Policy denied the operation.

exception fluree.errors.ConflictError

Bases: FlureeError

A concurrent change won; retrying against the new state may succeed.

When a commit lost a race, expected_t is the ledger t it was built on and head_t the t another commit had moved it to; both are None for other conflicts.

expected_t: int | None = None
head_t: int | None = None
exception fluree.errors.QueryTimeoutError

Bases: FlureeError, TimeoutError

The operation ran past its time limit.

exception fluree.errors.ResourceLimitError

Bases: FlureeError

The operation exceeded a fuel, memory, or size limit.

exception fluree.errors.DatabaseInUseError

Bases: FlureeError

The database directory is open in another process.

One process opens a directory at a time, and its threads share that connection. To use the same data from several processes, run fluree server on the directory and send requests to it. pid is the other process’s id, or None when it could not be read.

pid: int | None = None