User Experience - Errors/exceptions

Wondering what approaches others have used to providing a better user experience when ‘exceptions’ are encountered in the code. This may be just a matter of philosophy, but it seems to me that ‘out of the box’ Yii relies heavily on exceptions to provide user feedback.

Over time, I’ve come to rely less on exceptions. For example, I prefer to use redirects with flash messages for access denied situations. Mostly because the exception page is a ‘dead end’ in the road and the user will manually have to go back to where they were anyway.

I have the Yii Cookbook and in there the author uses an interesting approach - his ‘error’ landing page for 404’s is modified to present the visitor with an alternate list of options… something like “We can’t find what you are looking for - perhaps you were looking for link1, 2, or 3 instead”.

So - what is your approach when exceptions happen?

In general, if it’s an admin section, I just let the CHttpException propagate out to the error handler.

If it’s a regular page, I’ll do the same as you, setting a flash message and redirecting to an appropriate page.

The only problem with this approach is that it doesn’t emit a 404, so if there’s a dead link, search engine crawlers won’t be prompted to remove it.