Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error throw #223

Merged
2 commits merged into from
May 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### v3.2.1 (2016-05-24)

* Updates the RTM client to emit an UNABLE_TO_RTM_START event when all reconnection attempts are exhausted, rather than throwing an error
* Suppresses some spurious log lines when tests are run

### v3.2.0 (2016-05-23)

* Updates the `_makeAPICall` method to make the optional API args param optional to pass in, so the third param to this function can be either an opts object or a cb. This is to allow us to add optional arguments to API methods without it being a breaking change.
Expand Down
5 changes: 4 additions & 1 deletion lib/clients/rtm/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,10 @@ RTMClient.prototype.reconnect = function reconnect() {
// by the web client policy
this._connAttempts++;
if (this._connAttempts > this.MAX_RECONNECTION_ATTEMPTS) {
throw new Error('unable to connect to Slack RTM API, failed after max reconnection attempts');
this.emit(
CLIENT_EVENTS.UNABLE_TO_RTM_START,
'unable to connect to Slack RTM API, failed after max reconnection attempts'
);
}
setTimeout(bind(this.start, this), this._connAttempts * this.RECONNECTION_BACKOFF);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slack/client",
"version": "3.2.0",
"version": "3.2.1",
"description": "A library for creating a Slack client",
"main": "./index",
"scripts": {
Expand Down