コード例 #1
0
        // Token: 0x0600003D RID: 61 RVA: 0x00003D68 File Offset: 0x00001F68
        private void HandleEventError(MapiEvent mapiEvent, MailSubmissionResult result, LatencyTracker latencyTracker, string eventContext)
        {
            uint errorCode = result.ErrorCode;

            if (errorCode == 22U)
            {
                MailboxTransportSubmissionAssistant.IncrementSuccessfulPoisonNdrSubmissionPerfmon();
            }
            else if (errorCode == 23U)
            {
                MailboxTransportSubmissionAssistant.IncrementPermanentFailedPoisonNdrSubmissionPerfmon();
            }
            else if (HResult.IsHandled(errorCode))
            {
                if (HResult.IsNonActionable(errorCode))
                {
                    MailboxTransportSubmissionAssistant.IncrementNonActionableFailedSubmissionPerfmon();
                }
                else if (!HResult.IsMessageSubmittedOrHasNoRcpts(errorCode))
                {
                    MailboxTransportSubmissionAssistant.IncrementFailedSubmissionPerfmon();
                }
            }
            else if (HResult.IsRetryableAtCurrentHub(errorCode))
            {
                MailboxTransportSubmissionAssistant.IncrementTemporarySubmissionFailuresPerfmon();
            }
            MailboxTransportSubmissionAssistant.ComputePercentSubmissionsPerfmon(false);
            if (11U == errorCode)
            {
                MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TraceFail <string>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "Submission for message {0} was throttled, retry happens in 1 minute.", mapiEvent.ItemEntryIdString);
                MailboxTransportSubmissionAssistant.BeginTrackLatency(mapiEvent, latencyTracker, LatencyComponent.SubmissionAssistantThrottling);
                throw new TransientMailboxException(MailboxTransportSubmissionAssistant.RetryScheduleMessageThrottling);
            }
            if (errorCode == 1140850696U)
            {
                MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TraceFail <uint, string>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "Resource is in Quarantined State. Error Code: {0}; Event Context: {1}", errorCode, eventContext);
                throw new TransientMailboxException(new RetrySchedule(FinalAction.RetryForever, TimeSpan.MaxValue, new TimeSpan[]
                {
                    result.QuarantineTimeSpan
                }));
            }
            if (24U == errorCode)
            {
                MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TraceFail <uint, string>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "NDR for Poison Message was not successful. Retry. Error Code: {0}, Event context: {1}.", errorCode, eventContext);
                MailboxTransportSubmissionAssistant.IncrementTemporaryPoisonNdrSubmissionFailuresPerfmon();
                throw new TransientServerException(MailboxTransportSubmissionAssistant.RetrySchedulePoisonNdr);
            }
            if (HResult.IsHandled(errorCode))
            {
                MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TraceFail <uint, string>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "Submission was handled.  Error code {0}, event context {1}.", errorCode, eventContext);
                return;
            }
            if (2684354560U == errorCode)
            {
                MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TraceFail <string>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "Submission for message {0} was throttled at smtp, retry happens in 1 minute.", mapiEvent.ItemEntryIdString);
                throw new TransientMailboxException(MailboxTransportSubmissionAssistant.RetryScheduleGeneric);
            }
            if (HResult.IsRetryableAtCurrentHub(errorCode))
            {
                MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TraceFail <uint, string>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "Submission was not successful. Retry at current hub error code {0}, event context {1}.", errorCode, eventContext);
                if (HResult.IsRetryMailbox(errorCode))
                {
                    throw new TransientMailboxException(MailboxTransportSubmissionAssistant.RetryScheduleGeneric);
                }
                if (HResult.IsRetryMailboxDatabase(errorCode))
                {
                    throw new TransientDatabaseException(MailboxTransportSubmissionAssistant.RetryScheduleGeneric);
                }
                if (HResult.IsRetryMailboxServer(errorCode))
                {
                    throw new TransientServerException(MailboxTransportSubmissionAssistant.RetryScheduleGeneric);
                }
                return;
            }
            else
            {
                if (HResult.IsRetryableAtOtherHub(errorCode))
                {
                    MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TraceFail <uint, string>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "Submission was not successful. Retry other hub error code {0}, event context {1}.", errorCode, eventContext);
                    throw new TransientServerException(MailboxTransportSubmissionAssistant.RetryScheduleGeneric);
                }
                throw new InvalidOperationException("Internal error. ErrorCode is: " + errorCode);
            }
        }