Skip to content

Instantly share code, notes, and snippets.

@ankitvijay
Created April 20, 2021 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitvijay/d76a0b04b4b76a71be8bed9f4575df6a to your computer and use it in GitHub Desktop.
Save ankitvijay/d76a0b04b4b76a71be8bed9f4575df6a to your computer and use it in GitHub Desktop.
Register ExceptionHandler and ApplicationExceptionHandler
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
.
.
services.AddSingleton<IExceptionHandler, ExceptionHandler>();
.
.
}
public void Configure(IApplicationBuilder app)
{
app.UseMiddleware<ApplicationExceptionMiddleware>();
.
.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment