Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Avoid calling translate_exception with non-PGError exceptions.
Browse files Browse the repository at this point in the history
translate_exception was changed and now expects the exception to respond to "result", here:  rails#6397
ActiveRecord::StatementInvalid, which is the exception sometimes caught and retried in the "connection retry" logic, does not respond to "result" and fails on the call to translate_exception.

Fixes replication test suite failure.

This fix can be squashed with the other "connection retry" commit (21e4354) on future upgrades.
  • Loading branch information
jrafanie committed Feb 18, 2014
1 parent 361c296 commit 373aee4
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -1285,9 +1285,8 @@ def with_auto_reconnect
begin
yield
rescue Exception => e
case translate_exception(e,e.message)
when LostConnection; retry if auto_reconnected?
end
retry if auto_reconnected? && e.message =~ Regexp.union(*lost_connection_messages)

raise
end
end
Expand Down

0 comments on commit 373aee4

Please sign in to comment.