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

VisitTryStatement() public method

public VisitTryStatement ( System.Management.Automation.Language.TryStatementAst tryStatementAst ) : AstVisitAction
tryStatementAst System.Management.Automation.Language.TryStatementAst
return AstVisitAction
        public override AstVisitAction VisitTryStatement(TryStatementAst tryStatementAst)
        {
            try
            {
                tryStatementAst.Body.Visit(this);
            }
            catch (FlowControlException)
            {
                // flow control (return, exit, continue, break) is nothing the user should see and is propagated
                throw;
            }
            catch (Exception ex)
            {
                SetUnderscoreVariable(ex);

                // not yet considered: no catches, special catches!
                tryStatementAst.CatchClauses.Last().Body.Visit(this);
            }
            finally
            {
                if (tryStatementAst.Finally != null)
                {
                    tryStatementAst.Finally.Visit(this);
                }
            }

            return AstVisitAction.SkipChildren;
        }
ExecutionVisitor