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); } }
protected ValueTask <ActionEvent> NotifyErrorAsync(Exception ex) => NotifyActionEventAsync(ActionEvent.Create(ActionEventType.EvtError, ex));
protected ValueTask <ActionEvent> NotifyActionEventAsync(ActionEventType type, object target = null) => NotifyActionEventAsync(ActionEvent.Create(type, target));