Skip to content

Commit f12c72b

Browse files
authored
Add missing xml docs for IExceptionHandler (#48814)
1 parent 9f4b8b4 commit f12c72b

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerServiceCollectionExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public static IServiceCollection AddExceptionHandler<TService>(this IServiceColl
4242
}
4343

4444
/// <summary>
45-
///
45+
/// Adds an `IExceptionHandler` implementation to services. `IExceptionHandler` implementations are used by the exception handler middleware to handle unexpected request exceptions.
46+
/// Multiple handlers can be added and they're called by the middleware in the order they're added.
4647
/// </summary>
47-
/// <typeparam name="T"></typeparam>
48-
/// <param name="services"></param>
49-
/// <returns></returns>
50-
48+
/// <typeparam name="T">The type of the exception handler implementation.</typeparam>
49+
/// <param name="services">The <see cref="IServiceCollection"/> for adding services.</param>
50+
/// <returns>The modified <see cref="IServiceCollection"/>.</returns>
5151
public static IServiceCollection AddExceptionHandler<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(this IServiceCollection services) where T : class, IExceptionHandler
5252
{
5353
return services.AddSingleton<IExceptionHandler, T>();

src/Middleware/Diagnostics/src/ExceptionHandler/IExceptionHandler.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,22 @@
66
namespace Microsoft.AspNetCore.Diagnostics;
77

88
/// <summary>
9-
///
9+
/// Represents an interface for handling exceptions in ASP.NET Core applications.
10+
/// `IExceptionHandler` implementations are used by the exception handler middleware.
1011
/// </summary>
1112
public interface IExceptionHandler
1213
{
1314
/// <summary>
14-
///
15+
/// Tries to handle the specified exception asynchronously within the ASP.NET Core pipeline.
16+
/// Implementations of this method can provide custom exception handling logic for different scenarios.
1517
/// </summary>
1618
/// <param name="httpContext"></param>
1719
/// <param name="exception"></param>
1820
/// <param name="cancellationToken"></param>
19-
/// <returns></returns>
21+
/// <returns>
22+
/// A <see cref="ValueTask{TResult}"/> representing the asynchronous handling operation indicating
23+
/// <see langword="true"/> if the exception was
24+
/// handled successfully; otherwise <see langword="false"/>.
25+
/// </returns>
2026
ValueTask<bool> TryHandleAsync(HttpContext httpContext, Exception exception, CancellationToken cancellationToken);
2127
}

0 commit comments

Comments
 (0)