Kck.Exceptions.Abstractions
3.4.0
dotnet add package Kck.Exceptions.Abstractions --version 3.4.0
NuGet\Install-Package Kck.Exceptions.Abstractions -Version 3.4.0
<PackageReference Include="Kck.Exceptions.Abstractions" Version="3.4.0" />
<PackageVersion Include="Kck.Exceptions.Abstractions" Version="3.4.0" />
<PackageReference Include="Kck.Exceptions.Abstractions" />
paket add Kck.Exceptions.Abstractions --version 3.4.0
#r "nuget: Kck.Exceptions.Abstractions, 3.4.0"
#:package Kck.Exceptions.Abstractions@3.4.0
#addin nuget:?package=Kck.Exceptions.Abstractions&version=3.4.0
#tool nuget:?package=Kck.Exceptions.Abstractions&version=3.4.0
Kck.Exceptions.Abstractions
Structured HTTP-aware exception hierarchy — CustomException base with concrete types that map automatically to HTTP status codes via [HttpStatusCode] attribute.
Installation
dotnet add package Kck.Exceptions.Abstractions
Quick Start
// Throw typed exceptions in domain/application layer
public async Task<Order> GetOrderAsync(Guid id, CancellationToken ct)
{
var order = await _repo.GetByIdAsync(id, ct)
?? throw new NotFoundException($"Order {id} was not found.");
return order;
}
public async Task UpdateOrderAsync(UpdateOrderCommand cmd, CancellationToken ct)
{
if (cmd.Total <= 0)
throw new BadRequestException("Order total must be greater than zero.");
if (!await _auth.HasPermissionAsync(cmd.UserId, "orders.write", ct))
throw new UnauthorizedException("You do not have permission to update orders.");
}
// The exception middleware (Kck.Exceptions.AspNetCore) catches these
// and returns the correct HTTP status code automatically.
Configuration
This is a contracts-only package — no configuration required. Pair with Kck.Exceptions.AspNetCore for automatic HTTP mapping in ASP.NET Core.
Resources
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Kck.Exceptions.Abstractions:
| Package | Downloads |
|---|---|
|
Kck.Exceptions.AspNetCore
ASP.NET Core global exception handler for Kck exceptions. Maps Kck exception types to RFC 7807 ProblemDetails responses with correct HTTP status codes via [HttpStatusCodeAttribute]. Registered via AddKckExceptionHandling(). |
|
|
Kck.Pipeline.MediatR
MediatR-backed pipeline behaviors for Kck. Provides Authorization, Caching, Logging, Transaction, and Validation behaviors. DEPRECATED — use Kck.Pipeline.Mediator instead. Will be removed in a future version (KCK0200). |
|
|
Kck.Pipeline.Mediator
Mediator.Abstractions 3.x-backed pipeline behaviors for Kck. Provides Authorization, Caching, Logging, Transaction, and Validation cross-cutting behaviors. The recommended pipeline provider since Kck v2. Registered via AddKckMediator(). |
GitHub repositories
This package is not used by any popular GitHub repositories.