killbill / killbill-plugin-framework-ruby

Framework to write Kill Bill plugins in Ruby
http://killbill.io
8 stars 11 forks source link

confusing error messages due wrapping #42

Open kares opened 9 years ago

kares commented 9 years ago

the generated rescue blocks are trying to do too much the same way :

rescue Exception => e
  message = "Failure in add_payment_method: #{e}"
  unless e.backtrace.nil?
    message = "#{message}\n#{e.backtrace.join("\n")}"
  end
  logger.warn message
  raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("add_payment_method failure", e.message)

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 :

[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 :