sonata-project/SonataBlockBundle — pull request #36 by oparadis (2012-11-13 17:36:44+00:00)
Title: Feature proposal: exception strategy management

Currently, when not in debug mode, exceptions thrown in block services are completely ignored and are converted in blank blocks (no html). This may lead to unexpected behaviors in production since the page could end up being partially rendered with a cute 200 status without having control on what the user sees.

In debug mode, all exceptions are thrown and managed by the framework with a full exception page. While the exception page is handy, it only shows the first exception encountered and hides the block composition of the page. This can sometimes be confusing if you want to have a more global view of the problems encountered on a page.

This feature proposes to implement an exception strategy management in order to give control on how exceptions thrown by block services should be managed.

The aim is to handle all exceptions thrown by block services, identify which exceptions should be managed with "exception filters", and show the exceptions through "exception renderers". Filters and renderers can be configured globally or on a per block-type basis, and it is easy to add new custom filters or custom renderers.

You can find more information in the documentation (in the pull request).

Any though or suggestion is welcome !