Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

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

28,056 görüntüleme • 11 ay önce •via X (Twitter)

24 Yorum

Gurbinder profil fotoğrafı
Gurbinder11 ay önce

there is a better way...

Piyush Garg profil fotoğrafı
Piyush Garg11 ay önce

👏🏻

Name cannot be blank profil fotoğrafı
Name cannot be blank11 ay önce

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 profil fotoğrafı
Crystalzac11 ay önce

Error handling middleware is a cleaner approach 🤷‍♂️

Angurī Wappā profil fotoğrafı
Angurī Wappā11 ay önce

What the fuck language is this?

Tuhin Bhowmick (Sam) profil fotoğrafı
Tuhin Bhowmick (Sam)11 ay önce

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

Yash Solanki profil fotoğrafı
Yash Solanki11 ay önce

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 profil fotoğrafı
Divy Raj11 ay önce

that sounds like solid advice

Affan.tsx profil fotoğrafı
Affan.tsx11 ay önce

Very well explained sir

Ajay Singh profil fotoğrafı
Ajay Singh11 ay önce

Haan hitesh sir ne Samjha diya backend series main

Pratham M profil fotoğrafı
Pratham M10 ay önce

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 profil fotoğrafı
Bhavya Gupta11 ay önce

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

Komiriko profil fotoğrafı
Komiriko11 ay önce

The first thing to stop is express js

Emmanuel Boluwatife profil fotoğrafı
Emmanuel Boluwatife11 ay önce

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ş profil fotoğrafı
Durmuş Demirtaş11 ay önce

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

Nisab Mohd profil fotoğrafı
Nisab Mohd10 ay önce

a better way to do in express!

Abhishek profil fotoğrafı
Abhishek11 ay önce

Gd

Adebakin Olamilekan Olujimi profil fotoğrafı
Adebakin Olamilekan Olujimi11 ay önce

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 profil fotoğrafı
Aniket Baranwal11 ay önce

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

Florin D profil fotoğrafı
Florin D11 ay önce

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

Okegbemi Joshua profil fotoğrafı
Okegbemi Joshua11 ay önce

A more flexible way to achieve that.

‌‍ए एम् सी ए 🇮🇳²⁰²ˣ (मार्क 2 का परिवार) profil fotoğrafı
‌‍ए एम् सी ए 🇮🇳²⁰²ˣ (मार्क 2 का परिवार)11 ay önce

Ayu dark theme ?

Abhishek Mohan Kolge profil fotoğrafı
Abhishek Mohan Kolge10 ay önce

Why not use express-async-errors?

Sarthak Srivastav profil fotoğrafı
Sarthak Srivastav10 ay önce

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

Benzer Videolar