Global Error Handling | ASP.NET 6 REST API Following CLEAN ARCHITECTURE & DDD Tutorial | Part 4

preview_player
Показать описание


Follow me on 'em socials:

What is this series?
We'll build a REST API following Clean Architecture & Domain-Driven Design principles completely from scratch.
We will use .NET 6, EF Core, and common patterns such as CQRS, unit of work, repository, mediator, and more 💪🏽
We'll also use some awesome open-source libraries such as MediatR, FluentValidation, ErrorOr, Throw, Mapster, and more.
The developing environment will be visual studio code & dotnet CLI only. We will use awesome vscode plugins for everything from sending HTTP requests to connecting to our SQL database, debugging, and peeking at JWT tokens.
We will code and refactor multiple times to tackle the many concepts I want to teach. When the series will be over, you'll have a good understanding and intuition on how to use these patterns & libraries in your industry-level applications.

How often will a new part come out?
Once or twice a week.

What are we doing today?
We'll dive into Global Error Handling using the following approaches:
1. Error Handling Middleware
2. Exception Filter Attribute
3. UseExceptionHandler middleware & "error" endpoint

We'll learn about the Problem Details error model specification & how to use it in ASP.NET.
We'll even dive into the ASP.NET's source code & understand the magic behind the Problem method in the ControllerBase and then we'll create a custom ProblemDetailsFactory which will allow us to customize the problem details response.

#dotnet

00:00. Overview
02:05. Custom Error Handling Middleware
04:10. Custom Exception Filter Attribute
07:55. Problem Details Response RFC Specification
10:08. Problem Details Response from Error Handling Filter
12:10. UseExceptionHandler Middleware & Error Endpoint
15:55. Clone & Build ASP.NET Source Code
17:15. Deep Dive Into The Framework's Implementation
19:40. Implementing A Custom Problem Details Factory
Рекомендации по теме
Комментарии
Автор

Every time Copilot gives me what I want, I now can’t help but say “yeeesss?” Keep these videos coming; excellent content!

kmcdo
Автор

Just found your channel. Pure gold. I’ve been developing for 12 years, and I’ve never seen more precise content. Sometimes it’s great to see your own approaches validated and learn new ways of working and tools on the way

MrFallout
Автор

Really enjoying this series. I already learned a few cool things and am looking forward to the DDD parts💪

TheFeljoy
Автор

By far the best video on ErrorHandling I have ever seen. Very usefull and coincidentally what I'm about to implement in a project!

CRBarchager
Автор

This is so far the best video on Global error handling in rest api . Excellent video and eagerly waiting for the next one!!!

sushilb
Автор

Wow, today I started to build a new app just to learn some new things. I had some questions that I haven't found answers to for a while. You've already answered the some of them. Great guide!

TheScrowen
Автор

Really curios to hear what you thought of the video. Was diving into the framework's code useful? Would it have been better to only demonstrate the error endpoint with the factory instead of the various options?

amantinband
Автор

This playlist is incredible, I'm learning a lot of aspnet core features. Thank you so much for this!

mtsLeal
Автор

finally, thanks!

I'm learning asp net and did good job until that point when i realized that every extend or change led to 2-3 hours of debugging. Project was 100% monolith and i didn't know what to do. Yes, I could write working apps, but they were always very messy ;(

Keep going <3

edwardnovikov
Автор

These videos are so loaded with info, I have to slow them down to keep up

unhandledexception
Автор

Found this series now and I must say they are so good! You manage to fit so much helpful content in such a short time, and has really opened my eyes for new areas in dotnet.
Also, great to be able to follow your workflow (how to walk through other source code) and all the plugins used in vscode.

cpnpsnr
Автор

I love your pace. Thank you for all these detailed and direct to the point video. These videos are not for beginners but they can follow along and read about the methods and style of coding and patterns that you are following. Diving into the source code to give details of implementation is great. Really clear some of the things which happen magically.

vivekverma
Автор

Interesting approach with the error endpoint. My personal favorite is using an exception-handling middleware. I also like to implement the IMiddleware interface for strong typing, it won't hurt.

MilanJovanovicTech
Автор

Loving this series, please continue, Thank you

hpdev
Автор

Great video!
I'd like to note that you can actually inject a ProblemDetailsFactory either into a middleware or a filter attribute. So you can combine the benefit of using the ProblemDetailsFactory even with the 'middleware' or the 'filter' aproach.

batiku
Автор

Great ! Didn't know about the problem details rfc recommandation !

Chtonik
Автор

Hey,
Thanks for putting together this great video series on data engineering! I'm really enjoying it.
Keep up the great work

propro
Автор

Probably one of the best instructional videos I have watched!

PeriMCS
Автор

קצת תוכן ישראלי איכותי עם מבטא זה תמיד טוב 😁

danirdd
Автор

thanks for sharing all this information.. really appreciate your efforts. it helps alot.. keep sharing good stuff!!

ammarahmed