System.Management.Pash.Implementation.ExecutionVisitor.VisitThrowStatement C# (CSharp) 메소드

VisitThrowStatement() 공개 메소드

public VisitThrowStatement ( System.Management.Automation.Language.ThrowStatementAst throwStatementAst ) : AstVisitAction
throwStatementAst System.Management.Automation.Language.ThrowStatementAst
리턴 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