private static async Task RunAndStoreExceptionsAsync(this SpecFlowContext context, Func <Task> action, string key) { TeardownExceptionsBindings.VerifyBindingAvailable(context); try { await action().ConfigureAwait(false); } catch (Exception x) { StoreExceptionInContext(context, x, key); } }
private static void RunAndStoreExceptions(this SpecFlowContext context, Action action, string key) { TeardownExceptionsBindings.VerifyBindingAvailable(context); try { action(); } catch (Exception x) { StoreExceptionInContext(context, x, key); } }