instance method translate_exception

Ruby on Rails 3.1.12

Since v3.1.12 Last seen in v3.1.12

Signature

translate_exception(exception, message)

No documentation comment.

Parameters

exception req
message req
Source
# File activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 826
        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 826 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Mysql::Stmt::ActiveRecord::ConnectionAdapters::MysqlAdapter

Type at least 2 characters to search.

↑↓ navigate · open · esc close