been patching these before unfortunately I did not note those down, put since I run into it again previously I wanted to make sure it's not forgotten :
[stripe-plugin] Failure in add_payment_method: javax/sql/DataSource
arjdbc.jdbc.RubyJdbcConnection.setDataSourceFactory(RubyJdbcConnection.java:1788)
arjdbc.jdbc.RubyJdbcConnection.setupConnectionFactory(RubyJdbcConnection.java:1828)
arjdbc.jdbc.RubyJdbcConnection.doInitialize(RubyJdbcConnection.java:515)
arjdbc.jdbc.RubyJdbcConnection.initialize(RubyJdbcConnection.java:507)
incomplete (what's the deal with javax.sql.DataSource ?) a little inspect (+ join("\n ")) helped :
[stripe-plugin] Failure in add_payment_method: java.lang.NoClassDefFoundError: javax/sql/DataSource
arjdbc.jdbc.RubyJdbcConnection.setDataSourceFactory(RubyJdbcConnection.java:1788)
arjdbc.jdbc.RubyJdbcConnection.setupConnectionFactory(RubyJdbcConnection.java:1828)
arjdbc.jdbc.RubyJdbcConnection.doInitialize(RubyJdbcConnection.java:515)
arjdbc.jdbc.RubyJdbcConnection.initialize(RubyJdbcConnection.java:507)
... although there's actually more that can be improved so that patches are less needed :
current way is ~ fine for Ruby StandardErrors (with a slight #{e.inspect} tuning)
"more serious" Ruby Exception should be at least logged at the error level
this is quite fatal stuff such as LoadError or very fatal such as NoMemoryError
errors that come out as Java exceptions should be wrapped (cause should be kept)
Java Error should not be catched or at least should get re-thrown as they are ... ?
p.s. message = "#{message}\n #{e.backtrace.join("\n ")}" (Ruby style) for readability
the generated rescue blocks are trying to do too much the same way :
https://github.com/killbill/killbill-plugin-framework-ruby/blob/ba1e9/lib/killbill/gen/plugin-api/payment_plugin_api.rb#L443-L449
been patching these before unfortunately I did not note those down, put since I run into it again previously I wanted to make sure it's not forgotten :
incomplete (what's the deal with
javax.sql.DataSource
?) a littleinspect
(+join("\n ")
) helped :... although there's actually more that can be improved so that patches are less needed :
StandardError
s (with a slight#{e.inspect}
tuning)Exception
should be at least logged at theerror
level this is quite fatal stuff such asLoadError
or very fatal such asNoMemoryError
Error
should not be catched or at least should get re-thrown as they are ... ?message = "#{message}\n #{e.backtrace.join("\n ")}"
(Ruby style) for readability