Skip to content

Commit

Permalink
Refactor: include cause when warning from exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed Jan 17, 2022
1 parent 0b085b7 commit 93f8b6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/logstash/plugin_mixins/jdbc/jdbc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ def execute_statement
end
success = true
rescue Sequel::DatabaseConnectionError, Sequel::DatabaseError, Java::JavaSql::SQLException => e
details = { :exception => e.message }
details = { exception: e.class, message: e.message }
details[:cause] = e.cause.inspect if e.cause
details[:backtrace] = e.backtrace if @logger.debug?
@logger.warn("Exception when executing JDBC query", details)
else
Expand Down

0 comments on commit 93f8b6f

Please sign in to comment.