Raycynix.Extensions.Exceptions
3.0.0
dotnet add package Raycynix.Extensions.Exceptions --version 3.0.0
NuGet\Install-Package Raycynix.Extensions.Exceptions -Version 3.0.0
<PackageReference Include="Raycynix.Extensions.Exceptions" Version="3.0.0" />
<PackageVersion Include="Raycynix.Extensions.Exceptions" Version="3.0.0" />
<PackageReference Include="Raycynix.Extensions.Exceptions" />
paket add Raycynix.Extensions.Exceptions --version 3.0.0
#r "nuget: Raycynix.Extensions.Exceptions, 3.0.0"
#:package Raycynix.Extensions.Exceptions@3.0.0
#addin nuget:?package=Raycynix.Extensions.Exceptions&version=3.0.0
#tool nuget:?package=Raycynix.Extensions.Exceptions&version=3.0.0
Raycynix.Extensions.Exceptions
Raycynix.Extensions.Exceptions is the core exception handling package.
What it contains
AddRaycynixExceptions(...)- exception mapping
- secure data masking
- transient exception classification
- retry execution services
- background task execution helpers
- optional Microsoft
ILogger<T>diagnostics for retry and background execution - common Raycynix exception types
What it does not contain
- ASP.NET Core middleware
IApplicationBuilderextensions- HTTP response formatting
Usage
builder.Services.AddRaycynixExceptions(options =>
{
options.Map<InvalidOperationException>(
errorCode: "invalid_operation",
message: "The operation is not valid.",
statusCode: 400);
});
You can also customize mappings for domain-specific exceptions:
builder.Services.AddRaycynixExceptions(options =>
{
options.Map<UnauthorizedAccessException>(
errorCode: "access_denied",
message: "You do not have permission to perform this action.",
statusCode: 403);
});
For ASP.NET Core request pipeline integration, add Raycynix.Extensions.Exceptions.AspNetCore.
Logging
The package uses optional Microsoft ILogger<T> diagnostics when logging is registered in the application. No Raycynix logging provider is required.
Diagnostics cover retry attempts, retry exhaustion, background operation cancellation, and background operation failures. The package avoids logging secure detail payloads directly.
Contract Guarantees
- custom mappings must provide a non-empty error code and public message
- mapped HTTP status codes must be between 400 and 599
- configured mappings and validation errors are snapshotted during construction
- retry execution restores the previous error execution context after completion
- user-provided mapper, masker, classifier, retry executor, and background runner registrations are preserved
Migrating From 2.x
ExceptionMapperOptions.Mappingsis now read-only.- Invalid mapping delegates, status codes, error codes, and messages fail during setup.
ValidationException.ValidationErrorsnow exposesIReadOnlyDictionary<string, string[]>.- Null operation delegates and blank background operation names are rejected.
| 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
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Raycynix.Extensions.Common (>= 3.0.0)
- Raycynix.Extensions.Exceptions.Abstractions (>= 3.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Raycynix.Extensions.Exceptions:
| Package | Downloads |
|---|---|
|
Raycynix.Extensions.Exceptions.AspNetCore
ASP.NET Core middleware for secure structured Raycynix JSON error responses, validation errors, correlation metadata, and transient retry hints. |
GitHub repositories
This package is not used by any popular GitHub repositories.
v3.0.0 adds validated and read-only mapper contracts, defensive exception data snapshots, composite-name secret masking, bounded retry backoff, safe override-friendly DI registration, retry context cleanup, and stricter operation argument validation.