TrapStatementAst(IScriptExtent, TypeConstraintAst, StatementBlockAst) Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Construct a trap statement.
public:
TrapStatementAst(System::Management::Automation::Language::IScriptExtent ^ extent, System::Management::Automation::Language::TypeConstraintAst ^ trapType, System::Management::Automation::Language::StatementBlockAst ^ body);
public TrapStatementAst (System.Management.Automation.Language.IScriptExtent extent, System.Management.Automation.Language.TypeConstraintAst trapType, System.Management.Automation.Language.StatementBlockAst body);
new System.Management.Automation.Language.TrapStatementAst : System.Management.Automation.Language.IScriptExtent * System.Management.Automation.Language.TypeConstraintAst * System.Management.Automation.Language.StatementBlockAst -> System.Management.Automation.Language.TrapStatementAst
Public Sub New (extent As IScriptExtent, trapType As TypeConstraintAst, body As StatementBlockAst)
Parameters
- extent
- IScriptExtent
The extent of the trap statement, starting with the trap keyword and ending with the closing curly of the body.
- trapType
- TypeConstraintAst
The type handled by the trap statement, may be null if all exceptions are trapped.
- body
- StatementBlockAst
The handler for the error.
Exceptions
If extent
or body
is null.