Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 1.43 KB

readme.md

File metadata and controls

28 lines (21 loc) · 1.43 KB

AspNet.WebApi.Exceptions.Mapper

NuGet Version Build Status SonarQube Coverage Libraries.io dependency status License

About

Exception Mapper allow to map some Exception to ApiException and treat them in a certain way.

Usage

public void ConfigureServices(IServiceCollection services)
{
    services.AddExceptionMapper(options =>
    {
        options.Map<System.ArgumentException, BadRequestException>();
        options.Map<System.NullReferenceException, ApiException>();
    });
}

Requirements

Only .NET Core SDK (2.2.0 and above) required.