正在加载视频...

视频加载失败

Stop writing Try Catch Blocks in your Express.js routes.

28,056 次观看 • 10 个月前 •via X (Twitter)

24 条评论

Gurbinder 的头像
Gurbinder10 个月前

there is a better way...

Piyush Garg 的头像
Piyush Garg10 个月前

👏🏻

Name cannot be blank 的头像
Name cannot be blank10 个月前

It's kind of useless. You just create a custom error type holding the status and you do a middleware at the end handling them. You don't need to wrap every handler/controller with that.

Crystalzac 的头像
Crystalzac10 个月前

Error handling middleware is a cleaner approach 🤷‍♂️

Angurī Wappā 的头像
Angurī Wappā10 个月前

What the fuck language is this?

Tuhin Bhowmick (Sam) 的头像
Tuhin Bhowmick (Sam)10 个月前

So in spring boot world we have something called controller advice We throw the errors and write custom error handlers just once...

Yash Solanki 的头像
Yash Solanki10 个月前

It would be good if we can send a custom error msg also so that would make it more reusable i guess. I love these short form videos. Keep making it 🙌

Divy Raj 的头像
Divy Raj10 个月前

that sounds like solid advice

Affan.tsx 的头像
Affan.tsx10 个月前

Very well explained sir

Ajay Singh 的头像
Ajay Singh10 个月前

Haan hitesh sir ne Samjha diya backend series main

Pratham M 的头像
Pratham M10 个月前

what is we need to send custom error for specific failures like failing to execute db-queries . its i think its we are writting same just giving fuction a wrapper of try catch

Bhavya Gupta 的头像
Bhavya Gupta10 个月前

this is actually something which everyone should follow while working on the project

Komiriko 的头像
Komiriko10 个月前

The first thing to stop is express js

Emmanuel Boluwatife 的头像
Emmanuel Boluwatife10 个月前

The only issue I have with this is, sometimes you might want to handle errors differently for different routes. The use of closure is smart, Welldone 👏

Durmuş Demirtaş 的头像
Durmuş Demirtaş10 个月前

Just migrate to express v5 and you are good to go. No need for custom implementatin.

Nisab Mohd 的头像
Nisab Mohd10 个月前

a better way to do in express!

Abhishek 的头像
Abhishek10 个月前

Gd

Adebakin Olamilekan Olujimi 的头像
Adebakin Olamilekan Olujimi10 个月前

can you pls help those of us who dont understand indian with english translation on youtube videos been wanting to watch the system design tutorial but i just cant undersatnd what you saying

Aniket Baranwal 的头像
Aniket Baranwal10 个月前

Ye to @Hiteshdotcom ki chai aur backend me seekh liya tha

Florin D 的头像
Florin D10 个月前

This not solve the problem... you still using try catch

Okegbemi Joshua 的头像
Okegbemi Joshua10 个月前

A more flexible way to achieve that.

‌‍ए एम् सी ए 🇮🇳²⁰²ˣ (मार्क 2 का परिवार) 的头像
‌‍ए एम् सी ए 🇮🇳²⁰²ˣ (मार्क 2 का परिवार)10 个月前

Ayu dark theme ?

Abhishek Mohan Kolge 的头像
Abhishek Mohan Kolge10 个月前

Why not use express-async-errors?

Sarthak Srivastav 的头像
Sarthak Srivastav10 个月前

Been using this template for a while now, asyncHandlers, ApiError and ApiResponse as utils, boosted my code readability and error handling capabilities multifold. Cool stuff

相关视频