diff --git a/DigitalData.Core.Exceptions/DependencyInjection.cs b/DigitalData.Core.Exceptions/DependencyInjection.cs index ec40485..0ca90c1 100644 --- a/DigitalData.Core.Exceptions/DependencyInjection.cs +++ b/DigitalData.Core.Exceptions/DependencyInjection.cs @@ -4,9 +4,9 @@ namespace DigitalData.Core.Exceptions; public static class DependencyInjection { - public static IApplicationBuilder UseExceptionHandlingMiddleware(this IApplicationBuilder app) + public static IApplicationBuilder UseGlobalExceptionHandler(this IApplicationBuilder app) { - app.UseMiddleware(); + app.UseMiddleware(); return app; } } diff --git a/DigitalData.Core.Exceptions/ExceptionHandlingMiddleware.cs b/DigitalData.Core.Exceptions/GlobalExceptionHandlerMiddleware.cs similarity index 88% rename from DigitalData.Core.Exceptions/ExceptionHandlingMiddleware.cs rename to DigitalData.Core.Exceptions/GlobalExceptionHandlerMiddleware.cs index 2963c79..2e889d6 100644 --- a/DigitalData.Core.Exceptions/ExceptionHandlingMiddleware.cs +++ b/DigitalData.Core.Exceptions/GlobalExceptionHandlerMiddleware.cs @@ -10,17 +10,17 @@ using System.Text.Json; /// Captures exceptions thrown during the request pipeline execution, /// logs them, and returns an appropriate HTTP response with a JSON error message. /// -public class ExceptionHandlingMiddleware +public class GlobalExceptionHandlerMiddleware { private readonly RequestDelegate _next; - private readonly ILogger? _logger; + private readonly ILogger? _logger; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The next middleware in the request pipeline. /// The logger instance for logging exceptions. - public ExceptionHandlingMiddleware(RequestDelegate next, ILogger? logger = null) + public GlobalExceptionHandlerMiddleware(RequestDelegate next, ILogger? logger = null) { _next = next; _logger = logger;