Skip to content

Commit

Permalink
Move AddDefaultExceptionHandler method
Browse files Browse the repository at this point in the history
  • Loading branch information
marcominerva committed Feb 15, 2024
1 parent 45241d4 commit d214cb5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using TinyHelpers.AspNetCore.ExceptionHandlers;
using TinyHelpers.AspNetCore.TypeConverters;

namespace TinyHelpers.AspNetCore.Extensions;
Expand Down Expand Up @@ -78,4 +79,12 @@ public static IServiceCollection AddDefaultProblemDetails(this IServiceCollectio
return services;
}
#endif

#if NET8_0_OR_GREATER
public static IServiceCollection AddDefaultExceptionHandler(this IServiceCollection services)
{
services.AddExceptionHandler<DefaultExceptionHandler>();
return services;
}
#endif
}

0 comments on commit d214cb5

Please sign in to comment.