Exception Mapper allow to map some Exception to ApiException and treat them in a certain way.
public void ConfigureServices(IServiceCollection services)
{
services.AddExceptionMapper(options =>
{
options.Map<System.ArgumentException, BadRequestException>();
options.Map<System.NullReferenceException, ApiException>();
});
}
Only .NET Core SDK (2.2.0 and above) required.