Siemens.AspNet.ErrorHandling.Contracts
1.0.0
Prefix Reserved
dotnet add package Siemens.AspNet.ErrorHandling.Contracts --version 1.0.0
NuGet\Install-Package Siemens.AspNet.ErrorHandling.Contracts -Version 1.0.0
<PackageReference Include="Siemens.AspNet.ErrorHandling.Contracts" Version="1.0.0" />
paket add Siemens.AspNet.ErrorHandling.Contracts --version 1.0.0
#r "nuget: Siemens.AspNet.ErrorHandling.Contracts, 1.0.0"
// Install Siemens.AspNet.ErrorHandling.Contracts as a Cake Addin #addin nuget:?package=Siemens.AspNet.ErrorHandling.Contracts&version=1.0.0 // Install Siemens.AspNet.ErrorHandling.Contracts as a Cake Tool #tool nuget:?package=Siemens.AspNet.ErrorHandling.Contracts&version=1.0.0
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
This class is used to represent exceptions that occur during the authentication process. It provides a standardized way of reporting authentication-related errors to the client.
403 - AuthorizationDetailsException
This class is used to handle exceptions that occur due to authorization failures. It allows the application to send detailed error responses when a user lacks the necessary permissions.
404 - NotFoundDetailsException
This class is intended for situations where a requested resource cannot be found. It allows the application to return a standardized error message in such cases.
415 - UnsupportedMediaTypeDetailsException
This class is used to represent exceptions that occur when a client sends a request with a media type that is not supported by the server. It provides a standardized way to inform the client that the content type is not acceptable.
422 - ValidationDetailsException
This class is used to represent exceptions that occur due to validation failures. It extends the base problem details class with additional information about validation errors.
500 - InternalServerErrorDetailsException
This class is used for capturing internal server errors, providing a consistent structure for unexpected failures within the application.
503 - ServiceUnavailableDetailsException
This class is used when the application or a specific service is temporarily unavailable. It provides a mechanism to return an appropriate error response indicating service unavailability.
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. |
-
net8.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.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 214 | 10/13/2024 |