System.Management.Pash.Implementation.ExecutionVisitor.VisitThrowStatement C# (CSharp) Method

VisitThrowStatement() public method

public VisitThrowStatement ( System.Management.Automation.Language.ThrowStatementAst throwStatementAst ) : AstVisitAction
throwStatementAst System.Management.Automation.Language.ThrowStatementAst
return AstVisitAction
        public override AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst)
        {
            object targetObject = GetTargetObject(throwStatementAst);
            if (targetObject is Exception)
            {
                throw (Exception)targetObject;
            }

            string errorMessage = GetErrorMessageForThrowStatement(targetObject);
            throw new RuntimeException(errorMessage);
        }
ExecutionVisitor