forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExceptionCatchBlocks.cs
More file actions
48 lines (42 loc) · 2.17 KB
/
Copy pathExceptionCatchBlocks.cs
File metadata and controls
48 lines (42 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// 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
{
/// <summary>Provides the catch blocks used within this assembly.</summary>
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);
/// <summary>Gets the catch block in <see cref="HttpBatchHandler"/>.SendAsync.</summary>
public static ExceptionContextCatchBlock HttpBatchHandler
{
get { return _httpBatchHandler; }
}
/// <summary>Gets the catch block in <see cref="HttpControllerDispatcher"/>.SendAsync.</summary>
public static ExceptionContextCatchBlock HttpControllerDispatcher
{
get { return _httpControllerDispatcher; }
}
/// <summary>Gets the catch block in <see cref="HttpServer"/>.SendAsync</summary>
public static ExceptionContextCatchBlock HttpServer
{
get { return _httpServer; }
}
/// <summary>
/// Gets the catch block in <see cref="ApiController"/>.ExecuteAsync when using <see cref="IExceptionFilter"/>.
/// </summary>
public static ExceptionContextCatchBlock IExceptionFilter
{
get { return _exceptionFilter; }
}
}
}