Updated the versioning information in `DigitalData.Core.Exceptions.csproj` from `1.0.0` to `1.0.1` for `Version`, `AssemblyVersion`, and `FileVersion`. Removed package references for `Microsoft.AspNetCore.Http.Abstractions` version `2.3.0` and `Microsoft.Extensions.Logging.Abstractions` version `9.0.5`.
Enhanced `DigitalData.Core.Exceptions.csproj` with NuGet package metadata including `PackageId`, `Authors`, `Description`, and versioning details. Added `core_icon.png` asset to the package.
Modified `DigitalData.Core.sln` to change project build configurations from `Debug` to `Release` for multiple projects.
The entire `DependencyInjection` class has been removed, including the `UseGlobalExceptionHandler` extension method and its associated `using` directive. This change eliminates the functionality for setting up global exception handling middleware in the application.
Introduces `GlobalExceptionHandlerMiddleware` for managing exceptions in the request pipeline, logging them, and returning JSON error responses. A new project, `DigitalData.Core.Exceptions.Middleware`, is created to house this middleware and related classes. The `GlobalExceptionHandlerOptions` class allows for custom exception registration with specific HTTP status codes, while a new `HttpResponse` record encapsulates status codes and messages for structured responses. The middleware is registered in the `DependencyInjection` class for easy integration.
Updated DependencyInjection to use GlobalExceptionHandler.
Removed ExceptionHandlingMiddleware and added
GlobalExceptionHandlerMiddleware for unified exception
handling across the application.
Rewrote the `ExceptionHandlingMiddleware` class to improve structure and functionality, changing its namespace to `DigitalData.Core.Exceptions`. Updated the constructor to support a nullable logger and implemented null-conditional logging for unhandled exceptions. Added new package references in `DigitalData.Core.Exceptions.csproj` for `Microsoft.AspNetCore.Http.Abstractions` and `Microsoft.Extensions.Logging.Abstractions`. Introduced a new `DependencyInjection` class to register the middleware in the application's pipeline.
- Improved documentation in DIExtensions.cs for clarity.
- Added project reference to DigitalData.Core.Exceptions.
- Updated solution file to include DigitalData.Core.Exceptions.
- Introduced ExceptionHandlingMiddleware for global exception handling.
- Added BadRequestException and NotFoundException classes.
- Created DigitalData.Core.Exceptions project with .NET 7.0, 8.0, and 9.0 support.