public Task ExecuteExceptionFilterAsync(HttpActionExecutedContext context, CancellationToken cancellationToken)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            _exceptionFormatter.LogException(context.Exception);
            return(null);
        }
Beispiel #2
0
        internal static void HandleApplicationError(HttpContextBase context, IExceptionFormatter exceptionFormatter)
        {
            HttpServerUtilityBase httpServerUtility = context.Server;
            Exception             exception         = httpServerUtility.GetLastError();

            HttpException httpException = exception as HttpException;

            if (httpException != null)
            {
                exceptionFormatter.LogHttpException(context.Request, httpException);
            }
            else
            {
                exceptionFormatter.LogException(exception);
            }
        }