// Token: 0x0600097C RID: 2428 RVA: 0x00020BB4 File Offset: 0x0001EDB4
        internal static void RecordException(RequestContext requestContext, Exception exception)
        {
            HttpContext httpContext = requestContext.HttpContext;

            ErrorHandlerUtilities.LogExceptionCodeInIIS(requestContext, exception);
            RequestDetailsLogger getRequestDetailsLogger = OwaApplication.GetRequestDetailsLogger;

            if (getRequestDetailsLogger != null && getRequestDetailsLogger.ActivityScope != null)
            {
                getRequestDetailsLogger.ActivityScope.SetProperty(ServiceCommonMetadata.GenericErrors, exception.ToString());
            }
            else
            {
                ExTraceGlobals.CoreTracer.TraceDebug <bool, bool, Exception>(0L, "Couldn't append exception to server log. Logger is null: {0}, logger.ActivityScope is null: {1}, Exception: {2}", getRequestDetailsLogger == null, getRequestDetailsLogger != null && getRequestDetailsLogger.ActivityScope == null, exception);
            }
            OwaServerTraceLogger.AppendToLog(new TraceLogEvent("ErrorHandlerUtilities", null, "RecordException", exception.ToString()));
            try
            {
                Exception baseException = ErrorHandlerUtilities.GetBaseException(exception);
                httpContext.Response.Headers.Add("X-OWA-Error", baseException.GetType().FullName);
                if (baseException is WrongServerException)
                {
                    string value = ((WrongServerException)baseException).RightServerToString();
                    if (!string.IsNullOrEmpty(value))
                    {
                        httpContext.Response.Headers.Add(WellKnownHeader.XDBMountedOnServer, value);
                    }
                }
            }
            catch (HttpException arg)
            {
                ExTraceGlobals.CoreTracer.TraceDebug <HttpException, Exception>(0L, "Failed to add error headers to the response. {0}. Original exception: {1}", arg, exception);
            }
        }
Пример #2
0
        private static void LogException(Exception error)
        {
            if (!Globals.IsAnonymousCalendarApp)
            {
                RequestDetailsLogger.LogException(error, "OwaFaultHandler", "ProvideFault");
            }
            RequestContext requestContext = RequestContext.Current;

            if (requestContext != null)
            {
                ErrorHandlerUtilities.LogExceptionCodeInIIS(requestContext, error);
            }
        }