Method: ActiveRecord::ConnectionAdapters::IBM_DB2_I5#translate_exception
- Defined in:
- lib/active_record/connection_adapters/ibm_db_adapter.rb
#translate_exception(exception, message) ⇒ Object
T017|T023: raise the appropriate error
3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 |
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 3238 def translate_exception(exception, ) case error_number() when -803 RecordNotUnique.new(, exception) when -530 InvalidForeignKey.new(, exception) else # would just be "super(x,y)" if this code was in IBM_DBAdapter @adapter.class.superclass.instance_method(:translate_exception).bind(@adapter).call(, exception) end end |