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
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
===
~ Adam
Exactly.
If the contract says "Once we release Merb 1.0, we're not going to
change the public API for N major releases or M months" then it would
make sense to get it as close to perfect as possible before 1.0 drops.