Example #1
0
 void EnqueueAction(AsyncAction action, ProduceConsumerQueue queue, List <Exception> exceptions)
 {
     action.Completed += action_Completed;
     queue.EnqueueItem(
         () =>
     {
         if (Cancelling)     // don't start any more actions
         {
             return;
         }
         try
         {
             action.RunExternal(action.Session);
         }
         catch (Exception e)
         {
             Failure f = e as Failure;
             if (f != null && Connection != null &&
                 f.ErrorDescription[0] == Failure.RBAC_PERMISSION_DENIED)
             {
                 Failure.ParseRBACFailure(f, action.Connection, action.Session ?? action.Connection.Session);
             }
             exceptions.Add(e);
             // Record the first exception we come to. Though later if there are more than one we will replace this with non specific one.
             if (Exception == null)
             {
                 Exception = e;
             }
         }
     });
 }
Example #2
0
 protected override void RunSubActions(List <Exception> exceptions)
 {
     foreach (AsyncAction subAction in subActions)
     {
         AsyncAction action = subAction;
         action.Completed += action_Completed;
         _queuePC.EnqueueItem(
             () =>
         {
             try
             {
                 action.RunExternal(Session);
             }
             catch (Exception e)
             {
                 Failure f = e as Failure;
                 if (f != null && Connection != null &&
                     f.ErrorDescription[0] == Failure.RBAC_PERMISSION_DENIED)
                 {
                     Failure.ParseRBACFailure(f, Connection, Session ?? Connection.Session);
                 }
                 exceptions.Add(e);
                 // Record the first exception we come to. Though later if there are more than one we will replace this with non specific one.
                 if (Exception == null)
                 {
                     Exception = e;
                 }
             }
         });
     }
     lock (_lock)
     {
         Monitor.Wait(_lock);
     }
 }
Example #3
0
 void EnqueueAction(AsyncAction action, ProduceConsumerQueue queue, List<Exception> exceptions)
 {
     action.Completed += action_Completed;
     queue.EnqueueItem(
         () =>
         {
             if (Cancelling) // don't start any more actions
                 return;
             try
             {
                 action.RunExternal(action.Session);
             }
             catch (Exception e)
             {
                 Failure f = e as Failure;
                 if (f != null && Connection != null &&
                     f.ErrorDescription[0] == Failure.RBAC_PERMISSION_DENIED)
                 {
                     Failure.ParseRBACFailure(f, action.Connection, action.Session ?? action.Connection.Session);
                 }
                 exceptions.Add(e);
                 // Record the first exception we come to. Though later if there are more than one we will replace this with non specific one.
                 if (Exception == null)
                     Exception = e;
             }
         });
 }