For a framework which has a contract with it's users over it's public API staying the same....you sure do change it alot......
=== ~ Adam On Fri, Sep 26, 2008 at 1:21 PM, Yehuda Katz <[EMAIL PROTECTED]> wrote: > Since a few versions ago, the exception is `request.exceptions', which > supports exceptions that raise new exceptions. You usually want > request.exceptions.first. > -- Yehuda > > On Fri, Sep 26, 2008 at 10:25 AM, Adam French <[EMAIL PROTECTED]> wrote: >> >> 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 >> > >> > > >> > >> >> > > > > -- > Yehuda Katz > Developer | Engine Yard > (ph) 718.877.1325 > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
