UPGRADING.md in slack-ruby-client-0.17.0 vs UPGRADING.md in slack-ruby-client-1.0.0

- old
+ new

@@ -1,7 +1,49 @@ Upgrading Slack-Ruby-Client =========================== +### Upgrading to >= 1.0.0 + +#### Deprecated Methods + +Slack has deprecated all `channel` and `group` methods, which have been removed from the library. + +See [this announcement from Slack](https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api) for details. + +#### Error Handling + +As of 1.0.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`. + +```ruby +# Before +begin + client.auth_test +rescue Slack::Web::Api::Errors::SlackError + # Includes all server errors +end + +# After +begin + client.auth_test +rescue Slack::Web::Api::Errors::SlackError, Slack::Web::Api::Errors::ServerError + # Need to rescue the server errors separately from SlackError +end +``` + +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. + +```ruby +# Before +error = Slack::Web::Api::Errors::TimeoutError.new('timeout_error', response) +error.message +# => 'timeout_error' + +# After +error = Slack::Web::Api::Errors::TimeoutError.new(response) +error.message +# => 'timeout_error' +``` + ### Upgrading to >= 0.16.0 #### Removed Celluloid and Faye-Websocket Concurrency Support Concurrency support for `celluloid-io` and `faye-websocket` has been removed. If you are running a RealTime bot on Celluloid or Faye, you must upgrade to `async-websocket`. Please note that RealTime bots are deprecated by Slack, and we generally recommend you [migrate your classic, RealTime bot, to granular permissions](https://code.dblock.org/2020/11/30/migrating-classic-slack-ruby-bots-to-granular-permissions.html).