Error handling strategies in ASP.Net Core APIs

preview_player
Показать описание
Discussions about error handling strategies in Asp.Net Core apps are heated and far from having a generally accepted outcome. In this video I would like to present you the two major error handling strategies that you could use in your apps. I also explain the benefits of each one and which one is my preferred. But in the end, the most important thing is that you are aware of these strategies, the pros and cons of each one, so that you can make your own informed decisions.
#aspnetcore #dotnet #dotnetcore

Join this channel to get access to perks:

Mentioned videos:

Contents
1. Intro: 00:00
2. Strategy 1: Bubble up exceptions: 01:21
3. Strategy 2: Working with result objects: 06:33
Рекомендации по теме
Комментарии
Автор

Did research on something like this long time ago, but it seems everyone proffers to throw the exception and let the system crash instead of handling the error internally. Some other developers I have talked to say not even to catch an exception but focus on validating the inputs and make sure we do not get garbage in... Like you said, lot of different ways to handle this kind of situation. Thank you for the video!

victormoreno
Автор

Hi, what about caller of api, , for example in blazor if i get a problem details response from api, how should i handle those, throwing an exception in service layer of blazor or creating a service response object like you did in the video?

alfonsdeda
Автор

You still need to log those errors in case you want to carry out an investigation & all the details should be precise

marshallnyamadzawo