method
translate_exception
v3.2.13 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
translate_exception(exception, message)protected
No documentation available.
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1146
def translate_exception(exception, message)
case exception.result.error_field(PGresult::PG_DIAG_SQLSTATE)
when UNIQUE_VIOLATION
RecordNotUnique.new(message, exception)
when FOREIGN_KEY_VIOLATION
InvalidForeignKey.new(message, exception)
else
super
end
end