Refactor DIExtensions and add exception handling middleware
- 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.
This commit is contained in:
22
DigitalData.Core.Exceptions/NotFoundException.cs
Normal file
22
DigitalData.Core.Exceptions/NotFoundException.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace DigitalData.Core.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an exception that is thrown when a requested resource is not found.
|
||||
/// </summary>
|
||||
public class NotFoundException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NotFoundException"/> class.
|
||||
/// </summary>
|
||||
public NotFoundException()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NotFoundException"/> class with a specified error message.
|
||||
/// </summary>
|
||||
/// <param name="message">The message that describes the error.</param>
|
||||
public NotFoundException(string? message) : base(message)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user