IExceptionHandler in .NET 8.0
27 Jun

IExceptionHandler in .NET 8.0

IExceptionHandler is an interface introduced in .NET 8 for handling exceptions globally. ASP.NET Core applications use this interface internally for their built-in exception handling. This method is better than other approaches we’ve seen. The IExceptionHandler interface requires you to implement one method, TryHandleAsync, which works with the HTTP context and the error. A benefit is […]

read more »
01 Jun

Handling Exception with ‘When’ clause in Catch block

Introduction: C# 6.0 introduced several language enhancements to make code more expressive and developer friendly. One notable addition was the introduction of the ‘When’ clause in catch blocks, providing developers with a powerful tool for more refined exception handling. Exception Handling Basics: In C#, exception handling is typically done using try, catch, and optionally, finally […]

read more »