fluree.errors ============= .. py:module:: fluree.errors .. autoapi-nested-parse:: Exceptions raised by Fluree. Every error derives from :class:`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 --------------- .. py:exception:: FlureeError Bases: :py:obj:`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. .. py:attribute:: status :type: int | None :value: None .. py:exception:: InvalidRequestError Bases: :py:obj:`FlureeError`, :py:obj:`ValueError` The query, transaction, or argument is malformed or invalid. .. py:exception:: ShaclViolationError Bases: :py:obj:`InvalidRequestError` A write that would leave data breaking the ledger's SHACL shapes. ``violations`` lists each way it would, as the same :class:`ValidationResult` objects :meth:`Ledger.validate` reports, so a rejected write is handled like a failed validation. .. py:property:: violations :type: list[fluree._records.ValidationResult] Each way the write breaks the shapes, as :class:`ValidationResult` objects. .. py:exception:: UniqueConstraintError Bases: :py:obj:`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. .. py:attribute:: property :type: fluree._terms.IRI .. py:attribute:: value :type: str .. py:attribute:: graph :type: fluree._terms.IRI | None .. py:attribute:: existing_subject :type: fluree._terms.IRI .. py:attribute:: new_subject :type: fluree._terms.IRI .. py:exception:: NotFoundError Bases: :py:obj:`FlureeError`, :py:obj:`LookupError` A ledger, branch, commit, or graph does not exist. .. py:exception:: PermissionDeniedError Bases: :py:obj:`FlureeError`, :py:obj:`PermissionError` Policy denied the operation. .. py:exception:: ConflictError Bases: :py:obj:`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. .. py:attribute:: expected_t :type: int | None :value: None .. py:attribute:: head_t :type: int | None :value: None .. py:exception:: QueryTimeoutError Bases: :py:obj:`FlureeError`, :py:obj:`TimeoutError` The operation ran past its time limit. .. py:exception:: ResourceLimitError Bases: :py:obj:`FlureeError` The operation exceeded a fuel, memory, or size limit. .. py:exception:: DatabaseInUseError Bases: :py:obj:`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. .. py:attribute:: pid :type: int | None :value: None