コード例 #1
0
 private FailureRec(string failureType, string message, string stackTrace, string dataContext, FailureRec innerFailure)
 {
     this.Timestamp         = DateTime.UtcNow;
     this.FailureType       = failureType;
     this.FailureCode       = 0;
     this.MapiLowLevelError = 0;
     this.FailureSide       = null;
     WellKnownException[] exceptionTypes = new WellKnownException[1];
     this.ExceptionTypes = exceptionTypes;
     this.Message        = message;
     this.StackTrace     = stackTrace;
     this.DataContext    = dataContext;
     if (innerFailure != null)
     {
         this.InnerException = innerFailure;
     }
 }
コード例 #2
0
        internal static void Deserialize(SerializationInfo info, StreamingContext context, out string originalFailureType, out int mapiLowLevelError, out WellKnownException[] wkeClasses, out string remoteStackTrace)
        {
            originalFailureType = info.GetString("originalFailureType");
            mapiLowLevelError   = info.GetInt32("mapiLowLevelError");
            int @int = info.GetInt32("wkeCount");

            wkeClasses = new WellKnownException[@int];
            for (int i = 0; i < @int; i++)
            {
                wkeClasses[i] = (WellKnownException)info.GetInt32(string.Format("wke{0}", i));
            }
            try
            {
                remoteStackTrace = info.GetString("remoteStackTrace");
            }
            catch (SerializationException)
            {
                remoteStackTrace = null;
            }
        }
コード例 #3
0
 public SimpleBadItem(string name, WellKnownException wke, string configName) : this(name, new WellKnownException?(wke), null, configName)
 {
 }
コード例 #4
0
        private Exception Reconstruct(VersionInformation serverVersion)
        {
            LocalizedException ex             = null;
            Exception          innerException = (this.InnerException != null) ? this.InnerException.Reconstruct(serverVersion) : null;

            if (this.MrsErrorType == MailboxReplicationServiceFault.MRSErrorType.ProxyThrottlingLimitReached)
            {
                ex = new MRSProxyConnectionLimitReachedTransientException(this.Message, innerException);
            }
            else
            {
                WellKnownException ex2 = this.MatchWellKnownException(new WellKnownException[]
                {
                    WellKnownException.StaticCapacityExceededReservation,
                    WellKnownException.WlmCapacityExceededReservation,
                    WellKnownException.WlmResourceUnhealthy
                });
                if (ex2 != WellKnownException.None)
                {
                    switch (ex2)
                    {
                    case WellKnownException.StaticCapacityExceededReservation:
                        ex = new StaticCapacityExceededReservationException(this.ResourceName, this.ResourceType, this.Capacity);
                        break;

                    case WellKnownException.WlmCapacityExceededReservation:
                        ex = new WlmCapacityExceededReservationException(this.ResourceName, this.ResourceType, this.WlmResourceKey, this.WlmResourceMetricType, this.Capacity);
                        break;

                    case WellKnownException.WlmResourceUnhealthy:
                        ex = new WlmResourceUnhealthyException(this.ResourceName, this.ResourceType, this.WlmResourceKey, this.WlmResourceMetricType, this.LoadRatio, this.LoadState, this.LoadMetric);
                        break;
                    }
                }
                if (ex == null)
                {
                    if (this.MrsErrorType == MailboxReplicationServiceFault.MRSErrorType.Transient)
                    {
                        ex = new RemoteTransientException(this.Message, innerException);
                    }
                    else
                    {
                        ex = new RemotePermanentException(this.Message, innerException);
                    }
                }
            }
            IMRSRemoteException ex3 = ex as IMRSRemoteException;

            if (ex3 != null)
            {
                ex3.OriginalFailureType = this.ExceptionType;
                ex3.MapiLowLevelError   = this.MapiLowLevelError;
                ex3.RemoteStackTrace    = this.StackTrace;
                if (this.WKEClasses != null)
                {
                    ex3.WKEClasses = new WellKnownException[this.WKEClasses.Length + 1];
                    for (int i = 0; i < this.WKEClasses.Length; i++)
                    {
                        ex3.WKEClasses[i] = (WellKnownException)this.WKEClasses[i];
                    }
                    ex3.WKEClasses[this.WKEClasses.Length] = WellKnownException.MRSRemote;
                }
                else
                {
                    ex3.WKEClasses = CommonUtils.ClassifyException(ex);
                }
                if (serverVersion != null && !serverVersion[17])
                {
                    if (!CommonUtils.ExceptionIs(ex, new WellKnownException[]
                    {
                        WellKnownException.MRSMailboxIsLocked
                    }) && (MailboxReplicationServiceFault.DownlevelMailboxIsLockedFailureTypes.Contains(ex3.OriginalFailureType) || this.Message.StringId == MrsStrings.DestMailboxAlreadyBeingMoved.StringId || this.Message.StringId == MrsStrings.SourceMailboxAlreadyBeingMoved.StringId))
                    {
                        ex3.WKEClasses = new List <WellKnownException>(ex3.WKEClasses)
                        {
                            WellKnownException.MRSMailboxIsLocked
                        }.ToArray();
                    }
                    if (!CommonUtils.ExceptionIs(ex, new WellKnownException[]
                    {
                        WellKnownException.MapiNotFound
                    }) && ex3.OriginalFailureType == "MapiExceptionNotFound")
                    {
                        ex3.WKEClasses = new List <WellKnownException>(ex3.WKEClasses)
                        {
                            WellKnownException.MapiNotFound
                        }.ToArray();
                    }
                }
            }
            ex.ErrorCode = this.ErrorCode;
            return(ex);
        }