DSIBT.Library.AspNetCore.ExceptionHandling 1.0.0

dotnet add package DSIBT.Library.AspNetCore.ExceptionHandling --version 1.0.0                
NuGet\Install-Package DSIBT.Library.AspNetCore.ExceptionHandling -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DSIBT.Library.AspNetCore.ExceptionHandling" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DSIBT.Library.AspNetCore.ExceptionHandling --version 1.0.0                
#r "nuget: DSIBT.Library.AspNetCore.ExceptionHandling, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DSIBT.Library.AspNetCore.ExceptionHandling as a Cake Addin
#addin nuget:?package=DSIBT.Library.AspNetCore.ExceptionHandling&version=1.0.0

// Install DSIBT.Library.AspNetCore.ExceptionHandling as a Cake Tool
#tool nuget:?package=DSIBT.Library.AspNetCore.ExceptionHandling&version=1.0.0                

Exception Handling

Exception Handling is giving you the opportunity to manage all unhandled exceptions in a single point. By implementing this extension in your WebAPI project, you'll be able to catch all unhandled exceptions and return back a standard exception model as well as you'll be able to provide your own handler method which will be called once any unhandled exception is occured.

Moreover, you can provide different handler for different Exception types. For instance, HandlerX for ValidationException or HandlerY for UnAuthorizationException, and HandlerZ for the rest

Apart from that, you can customize logging by providing an ILogger interface to log the details once the exception is cought by the handler. UseExceptionDetails is important because once the default handler is used, it'll return back the exception details. If UseExceptionDetails is true, it returns the StackTrace of the Exception. When it is false, however, it returns the single message ("Internal Server Error Occured!") and 500 StatusCode. So you can use this details in your Dev or PreProd environment but not on production. On the other hand, logging the details is irrelevant to this parameter. No matter it is true or false, it logs everything with StackTrace.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 213 3/6/2023