instance method
translate_exception
Ruby on Rails 3.0.20
Since v3.0.20 Last seen in v3.0.20Signature
translate_exception(exception, message)
No documentation comment.
Parameters
-
exceptionreq -
messagereq
Source
# File activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 601
def translate_exception(exception, message)
return super unless exception.respond_to?(:errno)
case exception.errno
when 1062
RecordNotUnique.new(message, exception)
when 1452
InvalidForeignKey.new(message, exception)
else
super
end
end
Defined in activerecord/lib/active_record/connection_adapters/mysql_adapter.rb line 601
· View on GitHub
· Improve this page
· Find usages on GitHub