lostisland / faraday_middleware

Various Faraday middlewares for Faraday-based API wrappers
MIT License
557 stars 203 forks source link

Autoloads incomplete for FaradayMiddleware::RedirectLimitReached #198

Closed zenspider closed 4 years ago

zenspider commented 4 years ago

We have to explicitly require "faraday_middleware/response/follow_redirects" in our tests if we're to refer to FaradayMiddleware::RedirectLimitReached because the autoloads at the top are not sufficient.

iMacTia commented 4 years ago

This is an interesting point, I guess that's because the autoload expects the class FollowRedirects to be mentioned before loading the file. But the above doesn't work if you're rescuing errors defined in those classes 🤔...

Possible solution might be to define errors in a separate file that is always loaded. I'll take a look after we're done with the 1.0 release, this could possibly be back-ported to the 0.1x series as a bugfix.

olleolleolle commented 4 years ago

We have merged #247, which addresses this issue. Thanks for the report, it helps a lot!