Rkd.Scalar.Errors 2.13.0

dotnet add package Rkd.Scalar.Errors --version 2.13.0
                    
NuGet\Install-Package Rkd.Scalar.Errors -Version 2.13.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rkd.Scalar.Errors" Version="2.13.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rkd.Scalar.Errors" Version="2.13.0" />
                    
Directory.Packages.props
<PackageReference Include="Rkd.Scalar.Errors" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rkd.Scalar.Errors --version 2.13.0
                    
#r "nuget: Rkd.Scalar.Errors, 2.13.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rkd.Scalar.Errors@2.13.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rkd.Scalar.Errors&version=2.13.0
                    
Install as a Cake Addin
#tool nuget:?package=Rkd.Scalar.Errors&version=2.13.0
                    
Install as a Cake Tool

Rkd.Scalar.Errors

The errors of Rkd.Scalar for any layer — Domain, Application, Infrastructure. Throw them anywhere; WithProblemDetails() in the API project turns them into RFC 9457 problem details with a stable code.

dotnet add src/MyApp.Application package Rkd.Scalar.Errors
dotnet add src/MyApp.Api package Rkd.Scalar
// MyApp.Application — references Rkd.Scalar.Errors only
using Rkd.Scalar;   // RkdError, ProblemException, IProblemLogDetails

public static class CustomerErrors
{
    public const string AlreadyExists = "CUSTOMER_ALREADY_EXISTS";
}

if (await customers.ExistsAsync(command.Document, cancellationToken))
    throw RkdError.Conflict(CustomerErrors.AlreadyExists, "A customer with this document already exists.")
        .WithLogDetails($"document={command.Document}");   // logged, never sent to the client

// MyApp.Api — references Rkd.Scalar
builder.AddRkdScalar().WithProblemDetails();
{
  "title": "Conflict",
  "status": 409,
  "detail": "A customer with this document already exists.",
  "code": "CUSTOMER_ALREADY_EXISTS",
  "traceId": "00-…"
}
Type Use
RkdError Conflict, NotFound, UnprocessableEntity, Validation… with a stable error code
ProblemException The exception they create; derive from it for your own problems
IProblemLogDetails Technical details of your own exceptions, written to the log only

Namespace

Every type is in Rkd.Scalar, whichever package brings it (this one or Rkd.Scalar):

using Rkd.Scalar;
  • Not Rkd.Scalar.Errors: that is the name of the package, not a namespace.
  • Not Rkd.Problems: that is the dependency with the client side of the contract (HttpProblemException, EnsureSuccessOrThrowProblemAsync, ProblemCodes, ProblemMembers), what a failed call to another API throws. It has no ProblemException.

The same using in tests:

using Rkd.Scalar;

var problem = await Assert.ThrowsAsync<ProblemException>(() => service.CreateAsync(command, ct));
Assert.Equal(CustomerErrors.AlreadyExists, problem.Code);

Notes

  • Same types and namespace (Rkd.Scalar) used by Rkd.Scalar, which depends on this package.
  • Dependencies: Rkd.Problems (the member names and codes shared with the clients) and the ASP.NET Core shared framework, needed by ProblemException.ToProblemDetails(). No other package: no Scalar, OpenAPI, API versioning or authentication.
  • Validators, signers, key resolvers and HTTP log sinks implemented outside the API project are in Rkd.Scalar.Abstractions.

See the Rkd.Scalar documentation.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Rkd.Scalar.Errors:

Package Downloads
Rkd.Scalar

Zero-boilerplate Scalar wrapper for ASP.NET Core. Configures OpenAPI, API Versioning and Authentication (JWT with HMAC, RSA, ECDSA, OIDC/JWKS or async/KMS signing, Basic, API Key) in a few fluent lines, applies XML documentation comments automatically, standardizes errors as RFC 9457 problem details, with built-in documentation UI protection, a development login endpoint and configuration-based validators.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.13.0 0 11/28/2026
2.12.1 56 11/27/2026
2.12.0 163 11/10/2026
2.11.0 159 11/7/2026
2.10.0 168 10/28/2026