DriDrood.ErrorHandling
1.1.1
dotnet add package DriDrood.ErrorHandling --version 1.1.1
NuGet\Install-Package DriDrood.ErrorHandling -Version 1.1.1
<PackageReference Include="DriDrood.ErrorHandling" Version="1.1.1" />
<PackageVersion Include="DriDrood.ErrorHandling" Version="1.1.1" />
<PackageReference Include="DriDrood.ErrorHandling" />
paket add DriDrood.ErrorHandling --version 1.1.1
#r "nuget: DriDrood.ErrorHandling, 1.1.1"
#:package DriDrood.ErrorHandling@1.1.1
#addin nuget:?package=DriDrood.ErrorHandling&version=1.1.1
#tool nuget:?package=DriDrood.ErrorHandling&version=1.1.1
Error handling
Lightweight tool for clean error rising and catching. Unifies all errors - user input and system.
Installation
To install this nuGet package, open console in folder with your project and run:
dotnet add package DriDrood.ErrorHandling
For ASP.NET application run:
dotnet add package DriDrood.ErrorHandling.Asp
Using
ASP.NET application
Update your Program.cs
to return new error structure.
Add validation filter:
builder.Services.AddControllers(opt => {
opt.Filters.Add<DriDrood.ErrorHandling.Asp.ValidationFilter>();
});
Use ExceptionMiddleware as your first middleware (or second, if you are using any logging middleware):
app.UseMiddleware<DriDrood.ErrorHandling.Asp.ExceptionMiddleware>();
Now you can throw DriDrood.ErrorHandling.Asp.UserInputException anywhere in your app and it will return in a same way as any other error.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DriDrood.ErrorHandling:
Package | Downloads |
---|---|
DriDrood.ErrorHandling.Asp
Lightweight tool for clean error rising and catching. Unifies all errors - user input and system. |
GitHub repositories
This package is not used by any popular GitHub repositories.