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 1543863548bcd7515fac7b7b1931b6e23fedf80f 1 parent 9bc303c
Aaron Patterson tenderlove authored
5 activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
View
@@ -349,11 +349,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)
@@ -365,7 +366,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)
2  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
View
@@ -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.