From cfdc4752d08bb49d90d39058400a0f0c9924fae4 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Wed, 23 Oct 2019 12:25:02 -0700 Subject: [PATCH] let -> const and reject with error --- src/common/connection.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/connection.ts b/src/common/connection.ts index 69462ad7..9c2579b7 100644 --- a/src/common/connection.ts +++ b/src/common/connection.ts @@ -287,9 +287,9 @@ class Connection extends EventEmitter { connect(): Promise { this._clearReconnectTimer() return new Promise((resolve, reject) => { - let connectTimeout = setTimeout(() => { - reject(`Error: connect() timed out after ${this._connectionTimeout} ms. ` + - `If your internet connection is working, the rippled server may be blocked or inaccessible.`) + const connectTimeout = setTimeout(() => { + reject(new ConnectionError(`Error: connect() timed out after ${this._connectionTimeout} ms. ` + + `If your internet connection is working, the rippled server may be blocked or inaccessible.`)) }, this._connectionTimeout) if (!this._url) { reject(new ConnectionError(