Skip to content

Commit

Permalink
set the backtrace to prevent AR exceptions from lying to us
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Apr 22, 2011
1 parent d42e43b commit 3eae734
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -223,7 +223,9 @@ def log(sql, name = "SQL", binds = [])
rescue Exception => e
message = "#{e.class.name}: #{e.message}: #{sql}"
@logger.debug message if @logger
raise translate_exception(e, message)
exception = translate_exception(e, message)
exception.set_backtrace e.backtrace
raise exception
end

def translate_exception(e, message)
Expand Down

0 comments on commit 3eae734

Please sign in to comment.