2 ms·
But then you will never know in your code if there was an error. What if you want to send an other HTTP response in case of an error? With an exception you can
by pasta 10y ago
But then you will never know in your code if there was an error. What if you want to send an other HTTP response in case of an error?
With an exception you can still generate a json response, but also handle errors in the way you like.