From dc83f7e67f1ad1232f8eb0e8ebf9d65516e36354 Mon Sep 17 00:00:00 2001 From: Jakob Krigovsky Date: Fri, 29 Dec 2017 10:55:00 +0100 Subject: [PATCH] Document error handling --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0c871801..52fab6f7 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,14 @@ end all_members # many thousands of team members retrieved 10 at a time ``` +#### Error Handling + +If a request fails, a `Slack::Web::Api::Errors::SlackError` will be raised. The error message contains the error code. In case of multiple errors, the error codes are separated by commas. The original response is also accessible using the `response` attribute. + +If you exceed [Slack’s rate limits](https://api.slack.com/docs/rate-limits), a `Slack::Web::Api::Errors::TooManyRequestsError` will be raised instead. + +In any other case, a `Faraday::ClientError` will be raised. This may be the case if Slack is temporarily unavailable, for example. + ### RealTime Client The Real Time Messaging API is a WebSocket-based API that allows you to receive events from Slack in real time and send messages as user.