Soenneker.Exceptions.Suite
11.0.707
Prefix Reserved
dotnet add package Soenneker.Exceptions.Suite --version 11.0.707
NuGet\Install-Package Soenneker.Exceptions.Suite -Version 11.0.707
<PackageReference Include="Soenneker.Exceptions.Suite" Version="11.0.707" />
<PackageVersion Include="Soenneker.Exceptions.Suite" Version="11.0.707" />
<PackageReference Include="Soenneker.Exceptions.Suite" />
paket add Soenneker.Exceptions.Suite --version 11.0.707
#r "nuget: Soenneker.Exceptions.Suite, 11.0.707"
#:package Soenneker.Exceptions.Suite@11.0.707
#addin nuget:?package=Soenneker.Exceptions.Suite&version=11.0.707
#tool nuget:?package=Soenneker.Exceptions.Suite&version=11.0.707
Soenneker.Exceptions.Suite
A small set of application-layer exception types for entity conflicts, missing entities, authentication, authorization, and validation failures.
Install
dotnet add package Soenneker.Exceptions.Suite
Exception types
| Exception | Intended condition | Common HTTP mapping |
|---|---|---|
EntityAlreadyExistsException |
Creation conflicts with an existing entity | 409 Conflict |
EntityNotFoundException |
A requested entity does not exist | 404 Not Found |
UnauthorizedException |
Authentication is missing or failed | 401 Unauthorized |
ForbiddenException |
An authenticated caller lacks permission | 403 Forbidden |
ValidationException |
Supplied data fails application validation | 400 Bad Request |
The HTTP statuses are suggested application mappings. Throwing one of these exceptions does not create an HTTP response, log the error, roll back work, or register middleware.
Usage
using Soenneker.Exceptions.Suite;
if (await repository.Exists(id))
throw new EntityAlreadyExistsException($"Widget '{id}' already exists.");
Widget? widget = await repository.Find(id);
if (widget is null)
throw new EntityNotFoundException(typeof(Widget), id);
Map exceptions at the application boundary rather than catching and translating them throughout domain code. For example, ASP.NET Core middleware or an exception handler can translate known types to ProblemDetails, while unexpected exceptions remain server errors.
EntityNotFoundException has constructors that build a message from an entity name/type and optional key:
throw new EntityNotFoundException("Widget", "widget-123");
// Entity "Widget" (widget-123) was not found.
The key is included in Message through ToString(). Do not pass secrets or sensitive identifiers if exception messages may be logged or returned to clients. In general, expose stable client-safe problem details and keep internal exception messages out of production responses.
ValidationException carries only the standard exception message and inner exception; it does not provide a structured field-error collection. Its name can conflict with validation exceptions from other namespaces, so use a namespace alias or the fully qualified name when both are referenced.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Soenneker.Exceptions.Suite:
| Package | Downloads |
|---|---|
|
Soenneker.Utils.UserContext
A utility library for retrieving various user information from the request context |
|
|
Soenneker.Graph.Users
Microsoft Graph user creation, update, lookup, paging, and queued deletion operations. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.707 | 834 | 11/11/2026 |
| 11.0.706 | 3,238 | 10/27/2026 |
| 11.0.705 | 500 | 10/26/2026 |
| 11.0.704 | 541 | 10/26/2026 |
| 4.0.703 | 1,512 | 10/14/2026 |
| 4.0.702 | 291 | 10/14/2026 |
| 4.0.697 | 315 | 10/12/2026 |
| 4.0.696 | 159 | 10/12/2026 |
| 4.0.695 | 804 | 10/11/2026 |
| 4.0.694 | 3,418 | 9/24/2026 |
| 4.0.693 | 1,707 | 9/15/2026 |
| 4.0.692 | 1,078 | 9/12/2026 |
| 4.0.691 | 5,251 | 8/30/2026 |
| 4.0.689 | 6,194 | 7/28/2026 |
| 4.0.688 | 2,145 | 7/16/2026 |
| 4.0.687 | 5,285 | 6/18/2026 |
| 4.0.686 | 3,870 | 6/5/2026 |
| 4.0.685 | 159 | 6/5/2026 |
| 4.0.684 | 4,351 | 4/22/2026 |
| 4.0.683 | 3,886 | 3/12/2026 |
Upgrade .NET 11 release candidates to stable