[Rg 54] Dispatching errors to current controller

Lars Olsson lasso at lassoweb.se
Mon Jul 16 13:04:19 EDT 2007


Hi!

The current (0.1.2) behavior for handling errors seems to be to simply 
call /error, but that makes it hard (impossible?) to define different 
error handlers for different controllers. This seems to be hardcoded in 
ramaze/dispatcher/error.rb (lines 7-11):

HANDLE_ERROR = {
     Exception => [ 500, '/error' ],
     Ramaze::Error::NoAction => [ 404, '/error' ],
     Ramaze::Error::NoController => [ 404, '/error' ],
}

I'm not sure how hard it would be to change, but I think it would be 
better if it worked along the following lines:

1. First, check if the current controller has an error action/template 
pair. If that is the case, call the current controller's error action.

2. If the current controller does not have an error action/template 
pair, call the root controller's error action (/error).


What do you think?


(And about the different url mappings Jo mentioned earlier today...I've 
never used to second form...I didn't even knew it existed...so I guess I 
don't mind if the second form was dropped... :)   )

Kindly

/lasso

-- 
________________________________________
Lars Olsson
lasso at lassoweb.se
http://www.lassoweb.se/


More information about the Ramaze-general mailing list