Error Handling?

10 views
Skip to first unread message

Phil

unread,
Aug 15, 2009, 9:05:59 PM8/15/09
to Ramaze
How does Ramaze handle errors? It looks like a while back you could
override error() on a controller and it would run on any runtime
errors. It doesn't seem to work now, however.

Phil

unread,
Aug 16, 2009, 3:16:41 AM8/16/09
to Ramaze
(If this is a double post, then I screwed something up, sorry.)

How do I handle errors with Ramaze? It looks like a while back you
could override error() on a controller and it would run on any runtime
errors. It doesn't seem to work now, though.

Lars Olsson

unread,
Aug 16, 2009, 12:51:54 PM8/16/09
to Ramaze
Hi,

Missing actions is handled by Innate::Node,action_missing and other
exceptions can be caught with Rack::RouteExceptions.route. I'm not
sure how flexible it is, the docs hints that it can only handle static
routes. Perhaps someone else know if it is possible to calculate the
route at runtime?

/lasso

Phil

unread,
Aug 16, 2009, 2:01:01 PM8/16/09
to Ramaze
Ah, that works nicely. But, then how do I get at the exception?
There's some talk about Ramaze::Dispatcher::Error.current, but that no
longer works...

Phil

unread,
Aug 16, 2009, 2:40:02 PM8/16/09
to Ramaze
Got it!

request.env[Rack::RouteExceptions::EXCEPTION]

That was hard-fought right there. I'm going to go put it on the wiki
or something.
Reply all
Reply to author
Forward
0 new messages