jeudi 14 janvier 2016

Laravel 5.1 - Difference between throwing Exceptions and abort()

I've been throwing Exceptions when I wanted to halt an action during backend processing. I had forgotten that I could use the Laravel abort() method. Is there any reason to use abort() over throwing an Exception? Does it pretty much do the same thing?

I'm also asking because I noticed that while I'm tailing my logs, abort() doesn't show the stack trace, but throwing the Exception does. I don't need the stack trace in these cases, because I know why it's failing. I also don't want the logs to grow huge from these known failures.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire