Address issue 44.

This commit is contained in:
Karl Southern
2016-06-28 22:38:36 +01:00
parent 2b27f39088
commit ded1106b13
2 changed files with 6 additions and 3 deletions

View File

@@ -334,7 +334,10 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
end
def retry_exception?(exception)
return (exception.class != java.sql.SQLException or
RETRYABLE_SQLSTATE_CLASSES.include?(e.getSQLState[0,2]))
if exception.respond_to? 'getSQLState'
return RETRYABLE_SQLSTATE_CLASSES.include?(e.getSQLState[0,2])
end
true
end
end # class LogStash::Outputs::jdbc