6 Nov 2007 fxn   » (Master)

A humble contribution to Rails

In the upcoming Rails 2.0 there's a nice feature to be able to extract and DRY exception handling in controllers. If you declare this at the class level


  rescue_from SomeException, :with => :some_action

Rails catches SomeExceptions raised by any action and invokes some_action.

The initial implementation provided a useful feature but there was room for improvement. It used and underlying hash table with exception class names as keys and handlers as values. When an exception was being treated a table lookup by name was done. Thus, exception inheritance was not taken into account. That's important because a normal use case for that feature is to declare catchalls. Additionally, handler inheritance or priority were not expressable.

My coffee and I wrote a patch that adds those features and a few others the core team suggested it would be nice to have, and it is already in trunk.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!