示例#1
0
        private void TryWork(PumpMessage work)
        {
            try
            {
                work.Execute();
                if (work.Deferred != null)
                {
                    work.Deferred.Resolve();
                }
            }
            catch (Exception ex)
            {
                work.Deferred?.Reject(ex);
                PumpExceptionArgs exceptionArgs = new PumpExceptionArgs(ex);
                PumpException.Fire(exceptionArgs);

                if (exceptionArgs.Handled == false)
                {
                    if (ex.InnerException != null)
                    {
                        ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
                    }
                    else
                    {
                        ExceptionDispatchInfo.Capture(ex).Throw();
                    }
                }
            }
        }
示例#2
0
        private void TryWork(PumpMessage work)
        {
            try
            {
                work.Execute();
            }
            catch (Exception ex)
            {
                PumpExceptionArgs exceptionArgs = new PumpExceptionArgs(ex);
                PumpException.Fire(exceptionArgs);

                if (exceptionArgs.Handled == false)
                {
                    if (ex.InnerException != null)
                    {
                        ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
                    }
                    else
                    {
                        ExceptionDispatchInfo.Capture(ex).Throw();
                    }
                }
            }
#if PROFILING
            CliProfiler.Instance.TotalMessagesProcessed++;
#endif
        }
示例#3
0
        private void TryWork(PumpMessage work)
        {
            try
            {
                work.Execute();
            }
            catch (Exception ex)
            {
                PumpExceptionArgs exceptionArgs = new PumpExceptionArgs(ex);
                PumpException.Fire(exceptionArgs);

                if (exceptionArgs.Handled == false)
                {
                    throw;
                }
            }
#if PROFILING
            CliProfiler.Instance.TotalMessagesProcessed++;
#endif
        }