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

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -