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);
}