This is what I do myself (throw exception and handle it inside
errorController). But of course I also set
$this->getResponse()->setHttpResponseCode(404) or whatever the response code
is.

It has been working nicely so far, though one thing I'd like to fix, but
never actually thought about, is that I need to figure a way to take out the
actual user and display something friendly. But in the same time I'd like
this to be meaningful and somehow reflects the actual error. For example,
missing controller/action errors give a not found message, and so on.

Thinking about it now, I'm probably going to use the response code to figure
out the message to display, and the message would be looked up in the views
scripts. e.g. 404.phtml, 302.phtml.

Cheers,
- Amr

On Mon, Mar 10, 2008 at 4:20 PM, agatone <[EMAIL PROTECTED]> wrote:

>
> Hello,
>
> There is much of talk in capturing errors caused by missing
> controllers/actions or trapping exceptions. but no useful information on
> triggering errors inside ZF (ofcourse also sending proper http heders). So
> for example if user accesses some expired activation link i want to invoke
> 404 error and don't know what's good way to do it. Should i throw
> exception
> and handle it inside errorController rather than trying to invoke error?
>
> Ty
> --
> View this message in context:
> http://www.nabble.com/Triggering-errors-tp15950778s16154p15950778.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>

Reply via email to