Passing current tests for issue 46
This commit is contained in:
parent
0e2e883cd1
commit
0f37792177
|
@ -284,7 +284,7 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def retry_exception?(exception)
|
def retry_exception?(exception)
|
||||||
retrying = (exception.respond_to? 'getSQLState' and (RETRYABLE_SQLSTATE_CLASSES.include?(exception.getSQLState[0,2]) or @retry_sql_states.include?(exception.getSQLState)))
|
retrying = (exception.respond_to? 'getSQLState' and (RETRYABLE_SQLSTATE_CLASSES.include?(exception.getSQLState.to_s[0,2]) or @retry_sql_states.include?(exception.getSQLState)))
|
||||||
log_jdbc_exception(exception, retrying)
|
log_jdbc_exception(exception, retrying)
|
||||||
|
|
||||||
retrying
|
retrying
|
||||||
|
@ -292,10 +292,11 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
|
||||||
|
|
||||||
def log_jdbc_exception(exception, retrying)
|
def log_jdbc_exception(exception, retrying)
|
||||||
current_exception = exception
|
current_exception = exception
|
||||||
log_text = 'JDBC Exception. ' + (retrying ? 'Retrying' : 'No retry') + '.'
|
log_text = 'JDBC - Exception. ' + (retrying ? 'Retrying' : 'Not retrying') + '.'
|
||||||
|
log_method = (retrying ? 'warn' : 'error')
|
||||||
|
|
||||||
loop do
|
loop do
|
||||||
@logger.error(log_text, :exception => current_exception, :backtrace => current_exception.backtrace)
|
@logger.send(log_method, log_text, :exception => current_exception, :backtrace => current_exception.backtrace)
|
||||||
|
|
||||||
if current_exception.respond_to? 'getNextException'
|
if current_exception.respond_to? 'getNextException'
|
||||||
current_exception = current_exception.getNextException()
|
current_exception = current_exception.getNextException()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user