Exemplo n.º 1
0
 protected virtual ValueTask <ActionEvent> HandleExceptionAsync(Exception ex)
 {
     ++ErrorTimes;
     try
     {
         var @event = ActionEvent.Create(ErrorTimes < MaxReTryTimes ?
                                         ActionEventType.EvtRetry : ActionEventType.EvtError, ex);
         LogActionEvent(@event);
         return(Listener(this, @event));
     }
     catch (Exception e)
     {
         throw new Exception($"throw an unhandled exception when excute [{nameof(HandleExceptionAsync)}] method.", e);
     }
 }
Exemplo n.º 2
0
 protected ValueTask <ActionEvent> NotifyErrorAsync(Exception ex) => NotifyActionEventAsync(ActionEvent.Create(ActionEventType.EvtError, ex));
Exemplo n.º 3
0
 protected ValueTask <ActionEvent> NotifyActionEventAsync(ActionEventType type, object target = null)
 => NotifyActionEventAsync(ActionEvent.Create(type, target));