mustash.exc – Exception definitions

exception mustash.exc.Error(message: str | None = None, /)

Bases: Exception

An error has occurred in a Mustash function.

Parameters:

message (str | None)

Return type:

None

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception mustash.exc.DecodeError(message: str | None, /, *, line: int, column: int, offset: int)

Bases: Error, ValueError

A decode error has occurred in a string.

Parameters:
Return type:

None

line
column
offset
add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception mustash.exc.DropException

Bases: Error

A document should be dropped.

Return type:

None

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception mustash.exc.PipelineFailureException(*, document: Document, processor: Processor, exception: Exception)

Bases: Error

A pipeline has failed on a provided document.

This exception may be raised by Pipeline.apply(), to provide more context on the execution.

Parameters:
Return type:

None

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

document: Document

State of the document at exception time.

processor: Processor

Processor on which

exception: Exception

Exception that has occurred on the pipeline.