Пример #1
0
 public JobFaultedEvent(Guid jobId, TInput input, Exception exception)
 {
     JobId      = jobId;
     Input      = input;
     Timestamp  = DateTime.UtcNow;
     Exceptions = new FaultExceptionInfo(exception);
 }
Пример #2
0
        public bool TryConvert(Exception input, out ExceptionInfo result)
        {
            if (input != null)
            {
                result = new FaultExceptionInfo(input);
                return(true);
            }

            result = default;
            return(false);
        }
        public bool TryConvert(object input, out ExceptionInfo result)
        {
            switch (input)
            {
            case Exception exception:
                result = new FaultExceptionInfo(exception);
                return(true);

            case ExceptionInfo exceptionInfo:
                result = exceptionInfo;
                return(true);

            default:
                result = default;
                return(false);
            }
        }
Пример #4
0
        /// <summary>
        /// Adds an activity exception to the routing slip
        /// </summary>
        /// <param name="host"></param>
        /// <param name="name">The name of the faulted activity</param>
        /// <param name="activityTrackingNumber">The activity tracking number</param>
        /// <param name="timestamp">The timestamp of the exception</param>
        /// <param name="elapsed">The time elapsed from the start of the activity to the exception</param>
        /// <param name="exception">The exception thrown by the activity</param>
        public void AddActivityException(HostInfo host, string name, Guid activityTrackingNumber, DateTime timestamp, TimeSpan elapsed,
                                         Exception exception)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (exception == null)
            {
                throw new ArgumentNullException(nameof(exception));
            }

            var exceptionInfo = new FaultExceptionInfo(exception);

            ActivityException activityException = new ActivityExceptionImpl(name, host, activityTrackingNumber, timestamp, elapsed,
                                                                            exceptionInfo);

            _activityExceptions.Add(activityException);
        }
Пример #5
0
 public Faulted(Guid jobId, Exception exception)
 {
     JobId      = jobId;
     Timestamp  = DateTime.UtcNow;
     Exceptions = new FaultExceptionInfo(exception);
 }
Пример #6
0
        /// <summary>
        /// Adds an activity exception to the routing slip
        /// </summary>
        /// <param name="host"></param>
        /// <param name="name">The name of the faulted activity</param>
        /// <param name="activityTrackingNumber">The activity tracking number</param>
        /// <param name="timestamp">The timestamp of the exception</param>
        /// <param name="elapsed">The time elapsed from the start of the activity to the exception</param>
        /// <param name="exception">The exception thrown by the activity</param>
        public void AddActivityException(HostInfo host, string name, Guid activityTrackingNumber, DateTime timestamp, TimeSpan elapsed,
            Exception exception)
        {
            if (name == null)
                throw new ArgumentNullException(nameof(name));
            if (exception == null)
                throw new ArgumentNullException(nameof(exception));

            var exceptionInfo = new FaultExceptionInfo(exception);

            ActivityException activityException = new ActivityExceptionImpl(name, host, activityTrackingNumber, timestamp, elapsed,
                exceptionInfo);
            _activityExceptions.Add(activityException);
        }