Example #1
0
 private void RunContinuation(Task<Status> t, IScopedHandler handler, IContext context, AsyncRunner runner)
 {
     try
     {
         if (t.IsFaulted && t.Exception != null)
         {
             new ErrorHelper(context).WriteError(t.Exception.InnerException);
         }
         else
         {
             try
             {
                 runner.End(handler.Handler, context, t.Result);
             }
             catch (Exception ex)
             {
                 new ErrorHelper(context).WriteError(ex);
             }
         }
     }
     finally
     {
         handler.Dispose();
     }
 }