API reference
python:astx:astx.exceptions.CatchHandlerStmt
class CatchHandlerStmt
CatchHandlerStmt(body: Block[AST], name: Optional[Identifier] = None, types: Optional[Iterable[Expr] | ASTNodes[Expr]] = None, parent: Optional[ASTNodes] = None, loc: SourceLocation = NO_SOURCE_LOCATION)
Source: packages/astx/src/astx/exceptions.py:93
AST class for catch statements.
None means an untyped handler; an empty collection stays empty for semantic validation. Expressions allow qualified nominal references. Every supplied collection item is validated, including lazy iterables.
Attributes
-
kind — Kind of value or operation.; Type: ASTKind
-
body — Statements forming the body.; Type: Block[AST]
-
name — Name identifying this declaration.; Type: Optional[Identifier]
-
types — Types.; Type: Optional[ASTNodes[Expr]]
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
Methods
-
__init__ — Initialize the instance.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST structure of the object.