Per #96, views are rendered lazily, when the response is transmitted. At that point it's too late to intercept any render errors and replace them with a nice error page. The workaround seems to be to call request.render() manually and then call reply() with the rendered result.
This seems to negate a fair amount of the value that Vision provides. For one views may be rendered prematurely. Projects may also find it easier to forgo Vision and set up their own reply decorator that handles all of this directly.
Perhaps Vision could support a handler to rescue such render errors? It would receive the error and the reply / response, allowing it to send an alternative response instead.
Per #96, views are rendered lazily, when the response is transmitted. At that point it's too late to intercept any render errors and replace them with a nice error page. The workaround seems to be to call
request.render()manually and then callreply()with the rendered result.This seems to negate a fair amount of the value that Vision provides. For one views may be rendered prematurely. Projects may also find it easier to forgo Vision and set up their own reply decorator that handles all of this directly.
Perhaps Vision could support a handler to rescue such render errors? It would receive the error and the reply / response, allowing it to send an alternative response instead.