Skip to content

Conversation

@josh-lauer
Copy link

Ruby implements a method, Exception#message, which returns the result of calling #to_s on the exception object: https://ruby-doc.org/core-2.2.0/Exception.html#method-i-message

In the ApiError class, the constructor in some cases sets @message to be an HTTP::Response object. Removing the message attr_reader allows Exception#message to be called instead, which in turn calls #to_s. This change ensures that #message always returns a string, rather than sometimes unexpectedly returning an HTTP::Response object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant