Share via


TrapStatementAst(IScriptExtent, TypeConstraintAst, StatementBlockAst) Constructor

Definition

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.

Applies to