# HG changeset patch # User cin # Date 1414598086 -10800 # Node ID 0141a165d0329eb4588335c2da64e3802bc0aa65 # Parent a43745f81f1064a48a4a788b9dac24a9a07fa3b1 minor changes diff -r a43745f81f10 -r 0141a165d032 Implab/Implab.csproj --- a/Implab/Implab.csproj Thu Oct 23 17:50:09 2014 +0400 +++ b/Implab/Implab.csproj Wed Oct 29 18:54:46 2014 +0300 @@ -7,8 +7,6 @@ Library Implab Implab - 8.0.30703 - 2.0 true diff -r a43745f81f10 -r 0141a165d032 Implab/Safe.cs --- a/Implab/Safe.cs Thu Oct 23 17:50:09 2014 +0400 +++ b/Implab/Safe.cs Wed Oct 29 18:54:46 2014 +0300 @@ -58,6 +58,21 @@ } [DebuggerStepThrough] + public static IPromise InvokePromise(Action action) { + ArgumentNotNull(action, "action"); + + var p = new Promise(); + try { + action(); + p.Resolve(); + } catch (Exception err) { + p.Reject(err); + } + + return p; + } + + [DebuggerStepThrough] public static IPromise InvokePromise(Func> action) { ArgumentNotNull(action, "action");