raise NotFound, "User not found"

Then later in your exception controller

@_message = params[:exception].message

This will toss the exception's message into merb's "message" mechanism
(like Rails flash messages) to provide much more information to the
user about what exactly went wrong.  Simply do <%= message %> in view
somewhere and away you go.

Hopefully this helps
===
~ Adam



On Fri, Sep 26, 2008 at 9:00 AM, Matthijs Langenberg
<[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> When I raise a NotFound exception, and handle that inside my Exception
> controller.
> I feel like I'm losing the context where the exception got thrown from.
> I could raise a NotFound from a Pages controller, but also from a
> Users controller,
> thought I want to return a message like "page not found" or "user not
> found" to the visitor.
>
> I think raising a specific UserNotFound or PageNotFound exception might work,
> but I was wondering what you guys are using.
>
> Would it also be possible to get a hold of the original controller?
>
> - Matthijs
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to