Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nodirbek-abdulaxadov/globalerrorhandler
https://github.com/nodirbek-abdulaxadov/globalerrorhandler
Last synced: 30 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nodirbek-abdulaxadov/globalerrorhandler
- Owner: Nodirbek-Abdulaxadov
- Created: 2024-05-06T05:18:30.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-07-29T11:45:50.000Z (5 months ago)
- Last Synced: 2024-08-15T09:25:11.674Z (5 months ago)
- Language: C#
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# GlobalErrorHandler NuGet Package
## Overview
The GlobalErrorHandler NuGet package provides middleware and extension methods to handle and log exceptions globally in ASP.NET Core applications. It includes an `ErrorHandlerMiddleware` to catch exceptions and log them, and an extension method `UseErrorHandler` to easily integrate the middleware into the application pipeline.
## Installation
You can install the GlobalErrorHandler NuGet package via the NuGet Package Manager or the .NET CLI:
```bash
dotnet add package GlobalErrorHandler
```
## Usage
Register ErrorHandlerMiddleware
In your ASP.NET Core application's startup code, register the ErrorHandlerMiddleware by using the UseErrorHandler extension method:```csharp
using GlobalErrorHandler;
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.UseErrorHandler();
}
}```