Global Exception Handling in Asp.Net Core Web API using IExceptionHandler

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ม.ค. 2024
  • Global Exception Handling in Asp.Net Core Web API can be done using IExceptionHandler. The IExceptionHandler interface in asp.net core is a newly added concept and it is used to avoid try-catch from your asp.net core application by handling the exceptions globally.
    The IExceptionHandler interface in dotnet core can be used to handle the exceptions globally in all the asp.net core frameworks like asp.net core web api, minimal apis, blazor, asp.net core mvc etc.
    #exceptionhandling #iexceptionhandling #aspnetcore
    Join this channel to get access to the perks:
    / @nitish.kaushik
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 23

  • @egitim10
    @egitim10 4 หลายเดือนก่อน

    Very clear. Thanks Nitish

  • @kaushikbhadani
    @kaushikbhadani 6 หลายเดือนก่อน

    Thank you Nitish Kaushik! Your tutorial is very very nice. waiting for your new series...

  • @NaveenKumar-dc8jv
    @NaveenKumar-dc8jv 3 หลายเดือนก่อน +1

    Simple and good. :)

  • @TeemoPwnstar
    @TeemoPwnstar 2 หลายเดือนก่อน

    Excellent video - thank you Nitish

  • @sachinrajput4746
    @sachinrajput4746 6 หลายเดือนก่อน

    Thanks sir

  • @achalprajapati1192
    @achalprajapati1192 2 วันที่ผ่านมา

    if we are use Authorize attribute then How to handle Authorize exception handling?

  • @aamirkhan3657
    @aamirkhan3657 4 หลายเดือนก่อน +1

    how can i get the error message with status code from exception middleware and get it in api controller and send that in response to the user

  • @adarsharooradarsharoor5305
    @adarsharooradarsharoor5305 2 หลายเดือนก่อน

    How can we include it in the DLL's because all the business logics usually we write it inside the separate DLL's.

  • @vyshakhkm
    @vyshakhkm 5 หลายเดือนก่อน

    How can use this exception handler in POST request

  • @KnowlegeStream
    @KnowlegeStream 2 หลายเดือนก่อน

    How to register Exception handler with logger in Program.cs?

  • @farapar3783
    @farapar3783 6 หลายเดือนก่อน

    if my app can not to connect to db then how this handler can help because in my code i cant throw excetion

    • @nitish.kaushik
      @nitish.kaushik  6 หลายเดือนก่อน +1

      You don't have to throw the exception explicitly. I was throwing them just for the demo.
      Otherwise this Handler will catch all the exceptions.

  • @oveskhan687
    @oveskhan687 4 หลายเดือนก่อน

    can you show how to use this handler in console app

    • @nitish.kaushik
      @nitish.kaushik  3 หลายเดือนก่อน +1

      This is for Asp.Net core only

    • @oveskhan687
      @oveskhan687 3 หลายเดือนก่อน

      @@nitish.kaushik yes .net core console app. How to implement it on console app.

    • @nitish.kaushik
      @nitish.kaushik  3 หลายเดือนก่อน +1

      Asp. Net core is for web applications. Asp. Net core is a sub framework of dotnet core ecosystem and asp.net core is diff from console

  • @UnbiasedThamizhan
    @UnbiasedThamizhan หลายเดือนก่อน +1

    Your intention is right, but not clear; You have to stop and show the difference between two handlers.