Hi, When an exception comes from rails, it has a name, i.e: "AssociationTypeMismatch", so I can catch it like this: rescue ActiveRecord::AssociationTypeMismatch => e ... ... However, how can I catch and handle specific exceptions that come from the database. "rescue Exception => e" is not good enough. I want to be able to deal with them individually. for example, mysql throws a duplicate entry key error, how do I catch that in rails? Thanks, Alon.
on 2006-05-30 17:45
on 2006-05-30 21:57
I am trying to figure out if I need to use the database specific error codes, but I can't figure out how to access it from rails...