// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Web.Http.Batch; using System.Web.Http.Dispatcher; using System.Web.Http.Filters; namespace System.Web.Http.ExceptionHandling { /// Provides the catch blocks used within this assembly. public static class ExceptionCatchBlocks { private static readonly ExceptionContextCatchBlock _httpBatchHandler = new ExceptionContextCatchBlock(typeof(HttpBatchHandler).Name, isTopLevel: false, callsHandler: true); private static readonly ExceptionContextCatchBlock _httpControllerDispatcher = new ExceptionContextCatchBlock(typeof(HttpControllerDispatcher).Name, isTopLevel: false, callsHandler: true); private static readonly ExceptionContextCatchBlock _httpServer = new ExceptionContextCatchBlock(typeof(HttpServer).Name, isTopLevel: true, callsHandler: true); private static readonly ExceptionContextCatchBlock _exceptionFilter = new ExceptionContextCatchBlock(typeof(IExceptionFilter).Name, isTopLevel: false, callsHandler: true); /// Gets the catch block in .SendAsync. public static ExceptionContextCatchBlock HttpBatchHandler { get { return _httpBatchHandler; } } /// Gets the catch block in .SendAsync. public static ExceptionContextCatchBlock HttpControllerDispatcher { get { return _httpControllerDispatcher; } } /// Gets the catch block in .SendAsync public static ExceptionContextCatchBlock HttpServer { get { return _httpServer; } } /// /// Gets the catch block in .ExecuteAsync when using . /// public static ExceptionContextCatchBlock IExceptionFilter { get { return _exceptionFilter; } } } }