ServerError does not descend from InternalError#380
ServerError does not descend from InternalError#380dblock merged 8 commits intoslack-ruby:masterfrom
Conversation
dblock
left a comment
There was a problem hiding this comment.
This looks good. Care to cleanup my minor nits and I'll merge? Thank you.
| ### 0.18.0 (Next) | ||
|
|
||
| * Your contribution here. | ||
| * [#380](https://github.com/slack-ruby/slack-ruby-client/pull/380): Updates to server error classes and hierarchy (see [UPGRADING](UPGRADING.md) for more) - [@jmanian](https://github.com/jmanian). |
There was a problem hiding this comment.
No need to mention UPGRADING here, or our CHANGELOG will be littered with them.
| ##### Other Errors | ||
|
|
||
| In case of Slack temporarily unavailability a `Slack::Web::Api::Errors::ServerError` (`Slack::Web::Api::Errors::SlackError` subclass) subclasses will be raised and original `Faraday::Error` will be accesible via `exception.cause`. | ||
| In case of Slack temporarily unavailability a subclass of `Slack::Web::Api::Errors::ServerError` will be raised and original `Faraday::Error` will be accesible via `exception.cause`. (This is no longer a subclass of `Slack::Web::Api::Errors::SlackError`, see [UPGRADING](UPGRADING.md).) |
There was a problem hiding this comment.
Let's write "Since version X.Y.Z this class is no longer ... and remove see UPGRADING.
|
|
||
| As of 0.18.0 `Slack::Web::Api::Errors::ServerError` and its subclasses (introduced in 0.16.0) no longer extend `Slack::Web::Api::Errors::InternalError` or its parent `Slack::Web::Api::Errors::SlackError`. If you are rescuing `SlackError` or `InternalError` with the intention of including `ServerError` and its subclasses you should adjust your code to explicitly rescue `Slack::Web::Api::Errors::ServerError`. | ||
|
|
||
| Additionally the `initialize` method for `ParsingError`, `TimeoutError`, and `UnavailableError` have changed from `new(message, response)` to `new(response)`. The `message` is now built into the definition of these classes. If you are instantiating or raising these errors in your code (perhaps in tests) you will need to update your code. |
There was a problem hiding this comment.
Maybe add some before/after?
There was a problem hiding this comment.
You mean example code before and after? I can do that
|
@dblock Where's Travis? |
Not sure. Did they turn off travis-ci.org finally? Want to move us to GitHub actions? |
|
@jmanian I enabled travis-ci.com on the org, maybe next push will "just work"? Let's upgrade badges... |
|
@dblock Still no Travis. I originally opened this PR as a draft, maybe that confused it? I authed into Travis to see if I could do anything but the repo doesn't appear for me there. |
|
@jmanian I tried to trigger a build, which failed with some unexpected error. So I clicked a bunch of buttons on travis-ci.com: added a free plan, signed up for "Beta", migrated repos to travis-ci.com. Then the trigger seems to have worked. Try pushing again? PS: All this seems unnecessary. Should get off Travis. |
|
@dblock Success! |
|
Merged, merci. |
Resolves #373.
Notes:
SlackErrorand expecting it to rescueServerError.TooManyRequestsErrorto follow the same pattern for defining itsmessage. Not a breaking change, just implementation.Questions:
UnavailableErrorcould be"The server responded with #{status}". Thoughts on this? It could be considered a breaking change.messagepattern for all the descendants ofSlackErrordefined inerrors.rb, so that instead ofSlack::Web::Api::Errors::AccountInactive.new('account_inactive', response)it's simplySlack::Web::Api::Errors::AccountInactive.new(response). This would be a breaking change for anyone instantiating these error classes.To be done later, if this approach is good: