Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save PradeepLoganathan/24281bbc548336869f9e4a85f44b8877 to your computer and use it in GitHub Desktop.

Select an option

Save PradeepLoganathan/24281bbc548336869f9e4a85f44b8877 to your computer and use it in GitHub Desktop.
Static method to make it easier to use the exception handler middleware in startup class
using Microsoft.AspNetCore.Builder;
namespace thetalentbot.JobSeeker.Exceptions
{
public static class ExceptionHandlerMiddleware
{
public static IApplicationBuilder UseExceptionHandlingMiddleware(this IApplicationBuilder builder)
{
return builder.UseMiddleware<ExceptionHandler>();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment