private void ReportError(Race.ThrowingRunnable checkpoint, AtomicReference <Exception> error) { try { checkpoint.Run(); } catch (Exception t) { error.compareAndSet(null, t); } }
public static WorkerCommand <T, R> Command <T, R>(Race.ThrowingRunnable runnable) { return(StateConflict => { try { runnable.Run(); return null; } catch (Exception e) { throw e; } catch (Exception throwable) { throw new Exception(throwable); } }); }