Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix exception translation

  • Loading branch information...
commit 5e5118aa8ba821af6e615cfd2903b848ff8a9177 1 parent 438fce7
@tenderlove tenderlove authored
View
5 activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -353,11 +353,12 @@ def close
protected
- def translate_exception(e, sql)
+ def translate_exception_class(e, sql)
message = "#{e.class.name}: #{e.message}: #{sql}"
@logger.error message if @logger
exception = translate_exception(e, message)
exception.set_backtrace e.backtrace
+ exception
end
def log(sql, name = "SQL", binds = [], statement_name = nil)
@@ -369,7 +370,7 @@ def log(sql, name = "SQL", binds = [], statement_name = nil)
:statement_name => statement_name,
:binds => binds) { yield }
rescue => e
- raise translate_exception(e, sql)
+ raise translate_exception_class(e, sql)
end
def translate_exception(exception, message)
View
2  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -856,7 +856,7 @@ def prepare_statement(sql)
begin
@connection.prepare nextkey, sql
rescue => e
- raise translate_exception(e, sql)
+ raise translate_exception_class(e, sql)
end
# Clear the queue
@connection.get_last_result
Please sign in to comment.
Something went wrong with that request. Please try again.