StoryTeller.Grammars.SilentAction.AsCritical C# (CSharp) Method

AsCritical() public static method

public static AsCritical ( string type, object position, Action action, Node node ) : SilentAction
type string
position object
action Action
node StoryTeller.Model.Node
return SilentAction
        public static SilentAction AsCritical(string type, object position, Action<ISpecContext> action, Node node)
        {
            Action<ISpecContext> wrapped = c =>
            {
                try
                {
                    action(c);
                }
                catch (StorytellerCriticalException)
                {
                    throw;
                }
                catch (StorytellerCatastrophicException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    throw new StorytellerCriticalException("Failed at position '{0}'".ToFormat(position), e);
                }
            };

            return new SilentAction(type, position, wrapped, node);
        }