Phema.ExceptionHandling 2.0.0

Package Description

Install-Package Phema.ExceptionHandling -Version 2.0.0
dotnet add package Phema.ExceptionHandling --version 2.0.0
<PackageReference Include="Phema.ExceptionHandling" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Phema.ExceptionHandling --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Phema.ExceptionHandling, 2.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Phema.ExceptionHandling as a Cake Addin
#addin nuget:?package=Phema.ExceptionHandling&version=2.0.0

// Install Phema.ExceptionHandling as a Cake Tool
#tool nuget:?package=Phema.ExceptionHandling&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Phema.ExceptionHandling

  • Add async handlers support

Usage

internal sealed class MyExceptionHandler : IExceptionHandler
{
  public void HandleException(ExceptionContext context)
  {
    // handle exception, format output
  }
}

// register
services.AddPhemaExceptionHandling(configuration =>
  configuration.AddExceptionHandler<MyExceptionHandler>(e => e is MyException));
  
// somewhere in your mvc code
throw new MyException();
  • Works on top of IExceptionFilter
  • Handlers are scoped services
  • You can register handler type only once
  • Add order matters (first register more specific, when common handlers)

Phema.ExceptionHandling

  • Add async handlers support

Usage

internal sealed class MyExceptionHandler : IExceptionHandler
{
  public void HandleException(ExceptionContext context)
  {
    // handle exception, format output
  }
}

// register
services.AddPhemaExceptionHandling(configuration =>
  configuration.AddExceptionHandler<MyExceptionHandler>(e => e is MyException));
  
// somewhere in your mvc code
throw new MyException();
  • Works on top of IExceptionFilter
  • Handlers are scoped services
  • You can register handler type only once
  • Add order matters (first register more specific, when common handlers)

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.0.0 372 2/28/2019