symfony2 - Symfony 2 error handling exceptions vs flashbag -
symfony2 - Symfony 2 error handling exceptions vs flashbag -
i see in symfony 2 examples when eg record not exist, symfony 2 throws exception. not find such approach friendly end user. why should prefer throwing exception , not add together error messages @ flashbag?
in examples throws exception
throw $this->createnotfoundexception('message');
which redirects user 404 error page.
in cms, if record not found want show user 404 page opposed adding error flash handbag , redirecting them to, lets say, homepage.
i guess depends on applications needs, , how want handle it.
symfony2 error-handling
Comments
Post a Comment