You can manually clear the response body.

$response->clearBody()

I think I'll file a ticket and start work on improving the Exception handling with regards to plugins.

Waigani wrote:
Yeah, I'm trying that:

$this->getResponse()->setException(new Zend_Exception("test"));

It does get handled in dispatchLoopStartup by the error controller, but
orginal action also gets called as well as the error action (and you get two
views rendered - orginal and error). When I throw an exception in a plugin,
I want to stop everything and just handle that exception in the error
controller.



keith Pope-4 wrote:
Would adding an exception to the Response work though?

2008/11/4 Matthew Weier O'Phinney <[EMAIL PROTECTED]>:
-- Waigani <[EMAIL PROTECTED]> wrote
(on Monday, 03 November 2008, 09:59 PM -0800):
Is it possible? I want to throw an exception in the preDispatch of a
plugin
if you are not allowed to view the page. I then want to handle that
exception via the errorController. I can wrap the $front->dispatch() in
a
try / catch and catch the exception in the bootstrap, but then how do I
forward that onto the errorController, as the front controller has not
been
dispatched? I've read the manual and other posts and have not found an
answer nor an alternative method.
Currently, throwing exceptions in plugins is unhandled, and you must
handle them manually, as you are attempting to do.

Probably the easiest way to re-dispatch in this case is to simply set an
error message in the session, and then redirect to an error page where
you display that message.

We *have* noted this issue for a future Zend_Controller improvement.

--
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/


--
----------------------------------------------------------------------
[MuTe]
----------------------------------------------------------------------




Reply via email to