#93 Error Handling in async function | Error Handling in Express | A Complete NODE JS Course

preview_player
Показать описание
In this lecture, we are going to re-factor our code and learn how we can catch errors in an async function and handle it, without using try-catch block.

Комментарии
Автор

I came across the asyncErrorHandler while doing Brad Traversy's course. Unfortunately, he didn't explain what was actually happening in the asyncErrorHandler. I tried reading blog posts and watching other videos but still couldn't figure it out. This video however, explained it very clearly. Thanks a bunch for such a detailed explanation

HamzahAhmad-dbcy
Автор

Thanks for the wonderful tutorial. Very detailed explanation.

Leesdjo
Автор

I love this particular error handling method. Keep it up

josephuzuegbu
Автор

very nice, thank you for making this vdo. a bit complicated but with step by step explanation, you made it clearer. thx again.

MrQVeeBoo
Автор

thank you very much for your videos. im learning a lot ! Greetings from Argentina!

paulpna
Автор

Took from me a lot to understand, thanks for explanation

mahmoudkhalid
Автор

This is an exact copy paste codes of Jonas Schmedtmann on Udemy. But thanks from India coz of your efforts 🇮🇳

Anonymous-cwnx
Автор

But after this is asyncerrorhandler function we are not using our custom error function??

adarshkhatri
Автор

How can I pass my own message error that isn't defined in our schema? for example I don't want the error that come from mongoose.

Also the statusCode will always be a "500" cause "error.statusCode" will always be undefined. So are the "asyncHandler" supposed to be always return an internal server errror and not client error?
look here 6:01 now how do you pass the 400 status code that you removed?

ddkwymi
Автор

after global the error hadler you didn't use CustomError class all the errors comming same status code spesify that

chanelmalith
Автор

There is one bug i am facing after implementing the globalerrorhandler and asyncErrorHandler is if i give a get request with api/v1/movies/movie-statss it shows me 200 ok status code in response but no data . And I created the route for movie-stats . Same if I tried movie-status it shows me 200 ok resp with no data but when i hit movie-statsss with 3's it shows me it cant be change to ObjectId . Is there any reason behind it or I have done error ?

shubhamgoswami
Автор

Hey, one question, why do we not need to return an async function in asyncErrorHandler and use await for function call?

vinaykumarkharwar
Автор

Lol, this course is a complete copy of the udemy course.

MultiDonet
welcome to shbcf.ru