API reference
python:astx:astx.exceptions.ThrowStmt
class ThrowStmt
ThrowStmt(exception: Optional[Expr] = None, parent: Optional[ASTNodes] = None, loc: SourceLocation = NO_SOURCE_LOCATION, *, cause: Optional[Expr] = None)
Source: packages/astx/src/astx/exceptions.py:27
AST class for throw statements.
An absent exception models re-raising. An absent cause differs from an explicit LiteralNone, which suppresses implicit diagnostic context.
Attributes
-
kind — Kind of value or operation.; Type: ASTKind
-
exception — Exception being handled.; Type: Optional[Expr]
-
cause — Cause.; Type: Optional[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.