plaid / plaid-ruby

Ruby bindings for Plaid
https://plaid.com/docs
MIT License
228 stars 144 forks source link

Adds specific errors for connection timeout and failure #483

Closed Maimer closed 8 months ago

Maimer commented 9 months ago

This should be backwards compatible with the existing code as the new errors inherit from ApiError and maintain the same string signature of the previous errors.

Addresses the following issue: https://github.com/plaid/plaid-ruby/issues/428

@phoenixy1

Maimer commented 9 months ago

@phoenixy1 thoughts on this?

phoenixy1 commented 9 months ago

Thanks or the PR! I'm not really a rubyist -- I'll ask around internally for review but I would also appreciate opinions on this change from others users of this library. Cc: @kyledcline @ctlevi @enriquez @pradyumna2905 @bdewater

bdewater commented 9 months ago

+1 to this, it’s easier and idiomatic to rescue a specific subclass rather than matching on a string message.

phoenixy1 commented 9 months ago

ok, sounds like the people approve! I'll put this into the queue to work on -- hopefully we can get it in for the next clib release.

phoenixy1 commented 9 months ago

@Maimer I tried importing this upstream but the test suite will not run with this change and generates the following error:

/usr/src/app/lib/plaid/api_client.rb:26:in `<class:ApiClient>': uninitialized constant Plaid::ApiClient::ApiError (NameError)

Can you fix whatever it's missing (or give instructions on the fix it needs, if it's not part of the published clib)? Thanks!

Maimer commented 9 months ago

@Maimer I tried importing this upstream but the test suite will not run with this change and generates the following error:

/usr/src/app/lib/plaid/api_client.rb:26:in `<class:ApiClient>': uninitialized constant Plaid::ApiClient::ApiError (NameError)

Can you fix whatever it's missing (or give instructions on the fix it needs, if it's not part of the published clib)? Thanks!

I'll take a look at this and hopefully have a fix for you soon.

phoenixy1 commented 8 months ago

This has been merged into upstream and should be released with the next scheduled ruby client library release!