mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-07 22:35:48 +00:00
let -> const and reject with error
This commit is contained in:
@@ -287,9 +287,9 @@ class Connection extends EventEmitter {
|
|||||||
connect(): Promise<void> {
|
connect(): Promise<void> {
|
||||||
this._clearReconnectTimer()
|
this._clearReconnectTimer()
|
||||||
return new Promise<void>((resolve, reject) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
let connectTimeout = setTimeout(() => {
|
const connectTimeout = setTimeout(() => {
|
||||||
reject(`Error: connect() timed out after ${this._connectionTimeout} ms. ` +
|
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.`)
|
`If your internet connection is working, the rippled server may be blocked or inaccessible.`))
|
||||||
}, this._connectionTimeout)
|
}, this._connectionTimeout)
|
||||||
if (!this._url) {
|
if (!this._url) {
|
||||||
reject(new ConnectionError(
|
reject(new ConnectionError(
|
||||||
|
|||||||
Reference in New Issue
Block a user