Skip to content

Errors

errors

The refusal every experiment operation raises.

ExperimentErrorCode

ExperimentErrorCode = Literal['experiment-unknown', 'experiment-entry', 'experiment-name', 'experiment-data-pin', 'experiment-data-read', 'experiment-method', 'experiment-option', 'experiment-handler', 'experiment-link', 'experiment-reference', 'experiment-check', 'experiment-record', 'qiec-hole']

What an experiment refusal is about.

ExperimentError

ExperimentError(code: ExperimentErrorCode, message: str, *, file: str = '', line: int = 0, column: int = 0)

Bases: ValueError

An experiment that cannot be planned, run, exported, or checked.

PARAMETER DESCRIPTION
code

What the refusal is about.

TYPE: ExperimentErrorCode

message

What is wrong and what to write instead.

TYPE: str

file

The file the refusal is located in, or empty.

TYPE: str DEFAULT: ''

line

The 1-based line, or 0 when unlocated.

TYPE: int DEFAULT: 0

column

The 0-based column.

TYPE: int DEFAULT: 0

Source code in src/quivers/experiments/errors.py
def __init__(
    self,
    code: ExperimentErrorCode,
    message: str,
    *,
    file: str = "",
    line: int = 0,
    column: int = 0,
) -> None:
    self.code: ExperimentErrorCode = code
    self.message = message
    self.file = file
    self.line = line
    self.column = column
    location = file
    if line:
        location += f":{line}:{column}"
    super().__init__(f"{location}: {message}" if location else message)