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:103
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 — Type: ASTKind
-
body — Type: Block[AST]
-
name — Type: Optional[Identifier]
-
types — Type: Optional[ASTNodes[Expr]]
Methods
-
__init__ — Initialize the instance.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST structure of the object.