Exemple #1
0
        /// <summary>
        /// Runs the work.
        /// </summary>
        /// <param name="args">The <see cref="ExecutorRunArgs{TArgs}"/>.</param>
        internal async Task RunAsync(ExecutorRunArgs <TArgs> args)
        {
            try
            {
                await OnRunAsync(args).ConfigureAwait(false);

                OnPerRunType(args);
            }
            catch (Exception ex)
            {
                if (!args.HasException)
                {
                    args.SetException(ex);
                    OnPerRunType(args);
                }
                throw;
            }
        }
Exemple #2
0
        /// <summary>
        /// Runs the work.
        /// </summary>
        /// <param name="args">The <see cref="ExecutorRunArgs"/>.</param>
        internal async Task RunAsync(ExecutorRunArgs args)
        {
            try
            {
                await OnRunAsync(args);

                OnPerRunType(args);
            }
            catch (Exception ex)
            {
                if (!args.HasException)
                {
                    args.SetException(ex);
                    OnPerRunType(args);
                }

                throw;
            }
        }