Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aimenux/exceptionhandlingmiddlewaredemo

Using exception middleware to global handle errors
https://github.com/aimenux/exceptionhandlingmiddlewaredemo

exception-handling global-error-handling middleware net80 webapi

Last synced: about 2 months ago
JSON representation

Using exception middleware to global handle errors

Awesome Lists containing this project

README

        

[![.NET](https://github.com/aimenux/ExceptionHandlingMiddlewareDemo/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/aimenux/ExceptionHandlingMiddlewareDemo/actions/workflows/ci.yml)

# ExceptionHandlingMiddlewareDemo
```
Using exception middleware to global handle errors
```

In this demo, i m using an exception middleware in order to handle errors in the whole application.

Exceptions are thrown by :
>
- Infrastructure : see `Proxy` (which simulate an external instable web service)
>
- Domain : see `CompanyService` (which simulate some dummy eligibility rules)

Exceptions are catched by the exception middleware and formatted using [problem details specification](https://datatracker.ietf.org/doc/html/rfc7807)

**`Tools`** : net 8.0, xunit