Skip to content

gufo.err.types

Public API data types.

Anchor dataclass

Bases: object

Exact problem position (Python 3.11+).

Denotes operator of subscript which causes the problem.

Parameters:

Name Type Description Default
left int

Starting column.

required
right int

Stopping column.

required

CodePosition dataclass

Bases: object

Exact code position for Python 3.11+.

Parameters:

Name Type Description Default
start_line int

First line of code

required
end_line int

Last line of code

required
start_col int

Starting column (on start_line)

required
end_col int

Ending column (on end_line)

required
anchor Optional[Anchor]

Problem anchor

required

ErrorInfo dataclass

Bases: object

Current execution frame information.

Parameters:

Name Type Description Default
name str

Application or service name, as set by setup()

required
version str

Application or service version, as set by setup()

required
fingerprint UUID

Error fingerprint.

required
stack List[FrameInfo]

List of FrameInfo. Current execution frame is first.

required
exception BaseException

Exception instance, if caught.

required
timestamp Optional[datetime]

Error timestamp.

None
root_module Optional[str]

Optional root module, as set by setup()

None

get_app_top_frame()

Get application's top stack frame.

Find top stack frame belonging to the application, if root_module is set, or return stack top otherwise.

Returns:

Type Description
Optional[FrameInfo]
Optional[FrameInfo]
  • None otherwise.

ExceptionStub

Bases: Exception

Stub to deserialized exceptions.

Parameters:

Name Type Description Default
kls str

Exception class name

required
args Tuple[Any, ...]

Exception arguments

required

__str__()

Format exception to string.

Returns:

Type Description
str

Formatted string.

FrameInfo dataclass

Bases: object

Execution frame.

Parameters:

Name Type Description Default
name str

Current callable name.

required
source Optional[SourceInfo]

Optional SourceInfo procedure. May be missed on loader problems.

required
locals Dict[str, Any]

Dicts of local variables.

required
module Optional[str]

Python module name.

None

SourceInfo dataclass

Bases: object

Source context for frame.

Parameters:

Name Type Description Default
file_name str

Normalized file name.

required
first_line int

first line of source context.

required
current_line int

current execution line.

required
lines List[str]

List of lines, starting from first_line

required
pos Optional[CodePosition]

Optional exact code position for Python 3.11+

None