/RestExceptions

Extensible Web API middleware that maps all exceptions to standardized RFC7807-compliant HTTP responses.

Primary LanguageC#GNU Lesser General Public License v2.1LGPL-2.1

RestExceptions

Extensible Web API middleware that maps all exceptions to standardized RFC7807-compliant HTTP responses.

NuGet Packages

RestExceptions Package NuGet
RestExceptions NuGet

Documentation

You can read the documentation for RestExceptions on GitHub wiki.

Example response format (404)

{
  "type": "https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found",
  "title": "Not Found",
  "status": 404,
  "detail": "Content not found.",
  "instance": "/users/12",
  "traceId": "00-f3e52009f0966d717f93c9653ed45e26-750dad4218610f7f-00",
  "method": "GET",
  "requestId": "0HNE94J42PNH8:00000001"
}

Examples and sample project

A minimal API utilizing RestExceptions is included in the project files as an example.

Disclaimer

This project was generated using Stratis-Dermanoutsos/dotnet-empty-solution.