Fix NoMethodError when Slack is unavailable#188
Conversation
|
Good call! We generally need to handle 50x error codes differently from 40x error codes that contain a JSON body. |
|
By the way, that’s also on the roadmap for Faraday v1.0 (see lostisland/faraday#735). |
021a88b to
93cfe6e
Compare
|
I’ve now fixed the |
|
Perfect, care to rebase this please and I'll merge. Maybe describe error handling in README if you think it can be helpful to others, too. |
93cfe6e to
98362b2
Compare
|
Thanks, sorry didn't get a notification on rebase. |
I’ve now opened #190 which documents all of slack-ruby-client’s error handling. |
When Slack is experiencing connectivity issues and returns a
503 Service Unavailable, slack-ruby-client should throw aFaraday::ClientError. However, due toslack-ruby-client/lib/slack/web/faraday/response/raise_error.rb
Line 12 in ffe7ec8
NoMethodError: undefined method `[]' for nil:NilClassis raised (sincebodyisnil). The same error was also reported in #32.I haven’t looked into an actual fix yet but I figured submitting a failing test would help 🙂