Nest.js Crash Course #5 - Exception Handling

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

You are collaborating with the right people. He is the "Nest Man". Awesome!

teknolovedigital
Автор

Loved this tutorial! Best series to watch if you are familiar with node Js and just learning nest

uchekingsleyogbonna
Автор

Great series this! I wanted to learn nest and having these videos drip fed to me every couple of days is lovely

thrillmore
Автор

your such a great teacher (underrated)

youcefmantas
Автор

Love your nestjs series! May you also create tutorials on how we can write unit tests for decorators and interceptors (and those exported as decorators) too please! Thank you so much in advance - I cannot find any concrete examples on how to write unit tests for these and have a lot of trouble figuring it out myself!

shecodeshk
Автор

Hi, I'm watching from your playlist. I'm seeing #5 after #3, where is #4?

MohammadAApu
Автор

Hi Marius! I have a service that is creating records, updating and deleting against a DB. I want to throw errors from a Exception filter based on db errors. But I want the errors to be meaninful, like if I am creating it should throw a 422 UnprocessableEntity, if it is not found a 404 Not found, if it is an update another error. It is better to throw errors from the service and catch them in the exception filter? If a throw them from service I am not going to have the underlaying DB error or is there a way I could get that db data to send it through a logger? Thanks

EstebanHelgueroCardiff
Автор

Controllers should't have any logic, even try/catch blocks -- their purpose is to define the incoming/outgoing metadata (via decorators) and custom directives and relay to/from its service. The service should be responsible for throwing semantically correct errors/exceptions themselves. That way, the context of the error bubbles up to the controller, or some other service (such as a microservice, WS or other service) so they have the context of the error (whether it's a NotFoundException, or some Database exception). Then you apply custom Filters to each controller to handle these specific cases - one of which will hide any details of the error from the front-end in production that may expose things about our application that are best not exposed.This is my preference, of course, but it's in line with the ethos of Nest regarding separation of concerns. :)

gosnooky
Автор

idk what happened but tutorial #4 is missing from the playlist

DonAguinaldo
Автор

thank you so much. awesome course !!!~

addx-cf
Автор

your tutorials is always amazing. Can you do some tutorials on fastify too, please. I want also learn it but cannot understand the doc well.

danieldanish