[Rg 45] Re: Defining custom error action?
Jonathan Buch
john at oxyliquit.de
Sat Jun 30 13:30:39 EDT 2007
Hi,
> (I know this isn't Nitro general, but that's where I'm porting my app
> from...)
no worries, everything's fine. :)
> In Nitro I can customize the error handling in a controller på creating
> my own 'error' method. If I try to do the same in Ramaze I get
> "undefined method `each' for nil:NilClass" with the following stack
> trace:
> # The code that is causing the error
> class MainController < Ramaze::Controller
>
> def error
> # It doesn't matter what I put here, I always get the same error
> Thread.current[:exception].inspect
Sidenote: If you use the newest ramaze repo, you can use
Ramaze::Dispatcher::Error.current instead of the thread var.
> Is it possible to use a custom error handler in Ramaze?
I guess the standard error-template is still getting loaded, that'd be
my guess anyway. Did you try creating an (empty?) error.xhtml in the
template folder?
The error-handling in Ramaze is quite flexible, enabling you to create
different error handlers for different errors (I for example catch Og
errors nicely that way). error.rb for more info.
Hope that helps,
Jo
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
More information about the Ramaze-general
mailing list