Siemens.AspNet.ErrorHandling.Contracts
2.1.1
Prefix Reserved
dotnet add package Siemens.AspNet.ErrorHandling.Contracts --version 2.1.1
NuGet\Install-Package Siemens.AspNet.ErrorHandling.Contracts -Version 2.1.1
<PackageReference Include="Siemens.AspNet.ErrorHandling.Contracts" Version="2.1.1" />
paket add Siemens.AspNet.ErrorHandling.Contracts --version 2.1.1
#r "nuget: Siemens.AspNet.ErrorHandling.Contracts, 2.1.1"
// Install Siemens.AspNet.ErrorHandling.Contracts as a Cake Addin #addin nuget:?package=Siemens.AspNet.ErrorHandling.Contracts&version=2.1.1 // Install Siemens.AspNet.ErrorHandling.Contracts as a Cake Tool #tool nuget:?package=Siemens.AspNet.ErrorHandling.Contracts&version=2.1.1
Siemens.AspNet.ErrorHandling.Contracts
This package provides the essential data types and base classes used for error handling in ASP.NET Core applications. These classes are designed to standardize error responses and ensure consistency across different layers of your application.
We adhere to the RFC 7807 specification, which defines a standardized format for representing problem details in HTTP APIs. By using RFC 7807 , we ensure that error responses are consistent, easily interpretable by clients, and capable of conveying rich, structured information about errors. This approach enhances interoperability and helps developers diagnose issues more effectively.
Installation
To install the Siemens.AspNet.ErrorHandling.Contracts
package, you can use the NuGet Package Manager Console or the .NET CLI:
NuGet Package Manager Console
Install-Package Siemens.AspNet.ErrorHandling.Contracts
.NET CLI
dotnet add package Siemens.AspNet.ErrorHandling.Contracts
Classes
401 - AuthenticationDetailsException
The HTTP 401 Unauthorized response status code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource. This status code is sent with an HTTP WWW-Authenticate response header that contains information on how the client can request for the resource again after prompting the user for authentication credentials. This status code is similar to the 403 Forbidden status code, except that in situations resulting in this status code, user authentication can allow access to the resource.
403 - AuthorizationDetailsException
The HTTP 403 Forbidden response status code indicates that the server understands the request but refuses to authorize it. This status is similar to 401, but for the 403 Forbidden status code, re-authenticating makes no difference. The access is tied to the application logic, such as insufficient rights to a resource.
404 - NotFoundDetailsException
The HTTP 404 Not Found response status code indicates that the server cannot find the requested resource. Links that lead to a 404 page are often called broken or dead links and can be subject to link rot. A 404 status code only indicates that the resource is missing: not whether the absence is temporary or permanent. If a resource is permanently removed, use the 410 Gone status instead.
415 - UnsupportedMediaTypeDetailsException
The HTTP 415 Unsupported Media Type client error response code indicates that the server refuses to accept the request because the payload format is in an unsupported format. The format problem might be due to the request's indicated Content-Type or Content-Encoding, or as a result of inspecting the data directly.
422 - ValidationDetailsException
The HTTP 422 Unprocessable Content response status code indicates that the server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions. Clients that receive a 422 response should expect that repeating the request without modification will fail with the same error.
429 - TooManyRequestsDetailsException
The HTTP 429 Too Many Requests response status code indicates the user has sent too many requests in a given amount of time ("rate limiting"). A Retry-After header might be included to this response indicating how long to wait before making a new request.
500 - InternalServerErrorDetailsException
The HTTP 500 Internal Server Error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. This error response is a generic "catch-all" response. Usually, this indicates the server cannot find a better 5xx error code to response. Sometimes, server administrators log error responses like the 500 status code with more details about the request to prevent the error from happening again in the future.
503 - ServiceUnavailableDetailsException
The HTTP 503 Service Unavailable server error response code indicates that the server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. This response should be used for temporary conditions and the Retry-After HTTP header should, if possible, contain the estimated time for the recovery of the service.
ProblemDetails
This base class is a model for representing problem details in HTTP responses. It is designed to be compatible with RFC 7807 (Problem Details for HTTP APIs). Use this class as a base for your custom error response types.
ValidationProblemDetails
This class inherits from ProblemDetails and adds additional fields specifically for validation errors. It is used to represent the details of one or more validation failures that occurred during a request.
Related Packages
Siemens.AspNet.ErrorHandling
: This package contains the middleware for handling errors in ASP.NET Core applications. This package has Siemens.AspNet.ErrorHandling.Contracts
included.
License
This project is licensed under the terms specified in the LICENSE file. Please review the license file for details on usage, limitations, and permissions.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. 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. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Siemens.AspNet.ErrorHandling.Contracts:
Package | Downloads |
---|---|
Siemens.AspNet.ErrorHandling
A library which contains following functions: - Siemens.AspNet ErrorHandling Classes - Siemens.AspNet ErrorHandling Middleware - Siemens.AspNet ErrorHandling ExceptionHandlers |
GitHub repositories
This package is not used by any popular GitHub repositories.