plaid / plaid-ruby

Ruby bindings for Plaid

Home Page:https://plaid.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating a Plaid::ApiError object with a string as argument doesn't work as intended

phharvie opened this issue · comments

The documentation in the Plaid::ApiError says an error can be created in the following ways:

# Usage examples:
#   ApiError.new
#   ApiError.new("message")
#   ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
#   ApiError.new(:code => 404, :message => "Not Found")

However, creating an error with a string as the argument (second usage) doesn't work as intended.

# expected behavior
error = ApiError.new('Connection timed out')
error.message
=> "Connection timed out"

# actual behavior
error = ApiError.new('Connection timed out')
error.message
=> "Error message: the server returns an error"

The actual error message is the default error message for the class. This makes it difficult to implement custom error handling of timeouts, since the error message for timeouts is not distinct

Hello plaid team 👋 From your gemspec file, it looks like the latest gem version was generated with openapi-generator version 6.1.0.

According to the changelog of openapi-generator, the issue that caused this error message bug was fixed in version 6.3.0.
Could you please update to version 6.3.0 of openapi-generator so that this issue can be fixed? 🙏 🙇

commented

@JoshHaver thanks for looking into this and diagnosing it! Updating the openapi generator versions is always a little fiddlier than it should be, but I'll put this on the to-do list

commented

We've just merged an update to generate the ruby clib with version 6.3.0 of the generator, so this should be fixed with next week's post-Thanksgiving release

commented

The release vehicle for this shipped on monday, so I'm closing this out. Feel free to re-open if it's still happening with the latest version.