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(