private void WriteLogSearchError(LogSearchException e) { LocalizedException exception; ErrorCategory category; if (e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_LOG_UNKNOWN_LOG) { exception = new LocalizedException(Strings.LogNotAvailable); category = ErrorCategory.InvalidOperation; } else if (e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_UNKNOWN_SESSION_ID || e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_SESSION_CANCELED) { exception = new LocalizedException(Strings.SearchTimeout); category = ErrorCategory.OperationTimeout; } else if (e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_SERVER_TOO_BUSY) { exception = new LocalizedException(Strings.ServerTooBusy); category = ErrorCategory.ResourceUnavailable; } else if (e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_INVALID_QUERY_CONDITION || e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_INVALID_OPERAND_CLASS || e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_INCOMPATIBLE_QUERY_OPERAND_TYPES) { exception = new LocalizedException(Strings.OldServerSearchLogic); category = ErrorCategory.InvalidOperation; } else if (e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_UNRECOGNIZED_QUERY_FIELD) { exception = new LocalizedException(Strings.OldServerSchema); category = ErrorCategory.InvalidOperation; } else if (e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_MISSING_QUERY_CONDITION || e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_UNBOUND_QUERY_VARIABLE || e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_DUPLICATE_BOUND_VARIABLE_DECLARATION || e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_RESPONSE_OVERFLOW || e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_BAD_QUERY_XML || e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_MISSING_BOUND_VARIABLE_NAME) { exception = new LocalizedException(Strings.InternalError); category = ErrorCategory.InvalidOperation; } else if (e.ErrorCode == LogSearchErrorCode.LOGSEARCH_E_QUERY_TOO_COMPLEX) { exception = new LocalizedException(Strings.QueryTooComplex); category = ErrorCategory.InvalidOperation; } else { Win32Exception ex = new Win32Exception(e.ErrorCode); exception = new LocalizedException(Strings.GenericError(ex.Message), ex); category = ErrorCategory.InvalidOperation; } base.WriteError(exception, category, null); }
// Token: 0x060000F7 RID: 247 RVA: 0x00007404 File Offset: 0x00005604 public LogSession CreateSession(string name, Version schemaVersion) { ExTraceGlobals.ServiceTracer.TraceDebug((long)this.GetHashCode(), "MsExchangeLogSearch LogSessionManager CreateSession"); LogSession result; lock (this.sessionLock) { if (this.stopping) { throw new LogSearchException(LogSearchErrorCode.LOGSEARCH_E_SESSION_CANCELED); } Log log; if (!this.logs.TryGetValue(name, out log)) { throw new LogSearchException(LogSearchErrorCode.LOGSEARCH_E_LOG_UNKNOWN_LOG); } if (this.sessions.Count == 100) { LogSearchException ex = new LogSearchException(LogSearchErrorCode.LOGSEARCH_E_SERVER_TOO_BUSY); StringBuilder stringBuilder = new StringBuilder(5300); foreach (KeyValuePair <Guid, LogSession> keyValuePair in this.sessions) { stringBuilder.Append(keyValuePair.Key.ToString("N")); stringBuilder.Append(":"); stringBuilder.Append(keyValuePair.Value.LastActivity.ToString("y/M/d:H:m:s")); stringBuilder.Append(","); } ExWatson.AddExtraData(stringBuilder.ToString()); DiagnosticWatson.SendWatsonWithoutCrash(ex, "MaxSessionExceeded", TimeSpan.FromDays(1.0)); throw ex; } LogSession logSession = new LogSession(Guid.NewGuid(), log, schemaVersion); this.sessions[logSession.Id] = logSession; result = logSession; } return(result); }