Тёмный

How to handle Node.js errors like a Pro? 

Software Developer Diaries
Подписаться 35 тыс.
Просмотров 31 тыс.
50% 1

In this video, we're gonna learn the various best practices of Error Handling in Node.js, such as central error handling, graceful process exists and extending the JavaScript's Error object.
======⚡⚡⚡======
Licenses are valid only until the 31st of August 2013, first come first serve! ❤️
👉 Quokka License 1: wallabyjs.com/...
👉 Quokka License 2: wallabyjs.com/...
👉 Quokka License 3: wallabyjs.com/...
👉 Wallaby License 1: wallabyjs.com/...
👉 Wallaby License 2: wallabyjs.com/...
======⚡⚡⚡======
🙌 Become my Patreon and get exclusive perks: / softdevdiaries
💼 Follow me on LinkedIn and drop me a message if you'd like: / gusgadirov
💻 Also, let's connect on GitHub: github.com/gusgad
📚 Resources:
Original tutorial source: github.com/gol...
Code: github.com/gus...
And don't forget to subscribe for more videos like this 😊

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 33   
@prasannabiswas681
@prasannabiswas681 3 месяца назад
This are some next level through experience gained codes which you are passing to new developers........with great power comes great responsibility Hats off to you I just got placed in a company after a system design interview for Fullstack Developer role just by following this playlist. Couldn't thank you more sir.
@LarutanAK
@LarutanAK Год назад
Not long ago I had to revamp the error handling system of over 20 projects with over 5 different approachs mixed within them. Working on an enterprise level for a multibillion dollar company that has this kind of anti-pattern and literally no code review can be a nightmare, but it is extremely educational. Took me not much more than a couple of weeks of work time, but I am glad to see that the final result is pretty much what you taught on this video. Most junior and mid-level developers dont pay a lot of attention to error handling. This video is absolute gold in terms of best practices.
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Год назад
Thanks for sharing your story, that's very insightful. Would you say the points mentioned in the video are sufficient when it comes to the code. Or were there any other patterns you used when refactoring? :)
@LarutanAK
@LarutanAK Год назад
@@SoftwareDeveloperDiaries I really liked your approach, showing the do's and dont's (many of which I've seen during the process lol) I developed a library to centralize all error handling through a middleware, using a similar approach with an error dictionary and custom error types (easy to reuse on all projects). The biggest issue was how the errors were thrown: Promise.rejects, .catch(), just arbritrary throws and/or try-catches, or simply nothing at all... for that I went with hexagonal pattern, piping all errors towards the error-handler and its dictionary through a few adapters (simple and cleaner code) For the final result, any custom error can be simply added to the dictionary, along with a function that will handle the specifics for that error, or if the developer adds nothing custom, a default dictionary is used to create an error with all necessary logging and debbugging info.
@codingispower1816
@codingispower1816 8 месяцев назад
Would be cool to see an example of this library.@@LarutanAK
@Vriskh4oj
@Vriskh4oj 9 месяцев назад
Omg I am a self educated begginer developer, and 3 days ago, I did the same thing. I just felt the need to throw custom error. Im glad I fid the right thing
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries 9 месяцев назад
Let's goooo 🔥
@ayushpatel2171
@ayushpatel2171 5 месяцев назад
I am unable to understand the importance of Object.setPrototypeOf(this, new.target.prototype). Can you please explain the significance of this line.
@mroobert
@mroobert 2 месяца назад
Why do you need the isOperational flag? In isTrustedError if the error is istanceof AppError than is a trusted error. Is there a specific case where we need this isOperational with false / true?
@paperC_CSGO
@paperC_CSGO 3 месяца назад
Please do a video about performance tests in node! Testing locally + setting up tests for CI/CD
@renjithpn2002
@renjithpn2002 3 месяца назад
This is gold, thanks for sharing, expecting more like this! 🙂
@ayushpatel2171
@ayushpatel2171 5 месяцев назад
Do we have to create our own error dictionary or is there some sort of npm package for it?
@ManishBachani-i4w
@ManishBachani-i4w 7 месяцев назад
Damn, a good explanation no one is touching this depth of concepts like memory, handling error, and all stuff you are doing a great job!!
@vmmoorthi
@vmmoorthi 6 месяцев назад
You are delivering crucial things Thank you
@fisherhe5030
@fisherhe5030 8 месяцев назад
Really helpful for me. Thanks, guy.
@rajanacharya6360
@rajanacharya6360 Год назад
Great video. Subscribed!, I have been also following same approach. Would like to request you to consider making videos for topic like best practice, code quality, optimization, debugging, performant code etc.
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Год назад
Thank you! Those are already on the list ;)
@bafian
@bafian Год назад
you think it's okey to hardcode in the client side the httpCode ? or was this just an example and that httpCode property should only be used for network request errors?
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Год назад
The latter! I hardcoded it just to demonstrate it as an example 😉
@bafian
@bafian Год назад
@@SoftwareDeveloperDiaries haha oki dokis
@scottamolinari
@scottamolinari Год назад
It's pronounced walla"bee".
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Год назад
Oh thanks for the hint 😅
@enogratechnologies1896
@enogratechnologies1896 7 месяцев назад
Thanks for this.
@dawid_dahl
@dawid_dahl Год назад
Great video. Subscribed!
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Год назад
Happy to have you here, Dawid!
@acousticmunda6400
@acousticmunda6400 Год назад
OMG it is so helpful, I am feeling like a Pro now😅
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Год назад
Happy to help 🫡
Далее
Node.js Doesn’t Suck Anymore
16:59
Просмотров 113 тыс.
5 Async + Await Error Handling Strategies
18:11
Просмотров 22 тыс.
Node.js is a serious thing now… (2023)
8:18
Просмотров 650 тыс.
Express Error Handling
7:03
Просмотров 1 тыс.
The Most Important Skill You Never Learned
34:56
Просмотров 207 тыс.