Ejemplo n.º 1
0
        /// <summary>
        /// Gets infromation about the exception that occured and populates
        /// a <see cref="ReportedErrorEvent"/> object.
        /// </summary>
        private ReportedErrorEvent CreateReportRequest(ExceptionContext context)
        {
            ErrorContext errorContext = new ErrorContext
            {
                HttpRequest    = CreateHttpRequestContext(context),
                ReportLocation = ErrorReportingUtils.CreateSourceLocation(context.Exception)
            };

            return(new ReportedErrorEvent
            {
                Message = context.Exception.ToString() ?? "",
                Context = errorContext,
                ServiceContext = _serviceContext,
            });
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets infromation about the exception that occured and populates
        /// a <see cref="ReportedErrorEvent"/> object.
        /// </summary>
        private ReportedErrorEvent CreateReportRequest(ExceptionLoggerContext context)
        {
            ErrorContext errorContext = new ErrorContext()
            {
                HttpRequest    = CreateHttpRequestContext(context),
                ReportLocation = ErrorReportingUtils.CreateSourceLocation(context.Exception)
            };

            return(new ReportedErrorEvent()
            {
                Message = context.Exception.ToString() ?? "",
                Context = errorContext,
                ServiceContext = _serviceContext,
                EventTime = Timestamp.FromDateTime(DateTime.UtcNow),
            });
        }