Best Global Error Handler Middleware in Nodejs !
Vložit
- čas přidán 5. 07. 2024
- This is all you need to know to handle errors in Nodejs the right way
Any video suggestions? Put them down in the comments section !
Timestamps:
---------------------
0:00- Introduction
0:25- Explaining the base project
0:43- Explaining the errors file
1:40- Explaining the rest of the project
3:33- Testing the first API
5:25- Adding try/catch and throwing an error
7:00- Using our custom errors
8:00- Creating our error handler middleware
9:20- Making use of next()
9:50- Testing the API again with the error handler
10:40- Handling Joi validation errors
11:20- Passing the custom error messages to our middleware
12:30- Returning our custom errors from our middleware
13:30- Testing the API with our custom errors
13:56- Fixing the response status based on our error
14:45- Handling unknown errors
16:30- Enhancing our error reponse
19:05- Practising the steps learned on a second API
20:24- Outro
❤❤
Great work
Thank you!