Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set the failed http response in a custom attribute instead of cause
`#cause` in a custom error should return the expected class. This commit updates the custom value that is useful to store, the response, to use a specific name rather than overriding `#cause`’s behavior. Ruby documentation explains that the default expectation of #cause is that it will return either `an_exception` or `nil`. By setting an `HTTP::Response` to return from `#cause`, tools utilizing it may expect to send messages that may fail. https://ruby-doc.org/3.2.6/Exception.html#method-i-cause Specifically, I experienced a `NoMethodError: undefined method 'backtrace'` when an error occurred within `pry`.
- Loading branch information