mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 13:05:49 +00:00
let -> const and reject with error
This commit is contained in:
@@ -287,9 +287,9 @@ class Connection extends EventEmitter {
|
||||
connect(): Promise<void> {
|
||||
this._clearReconnectTimer()
|
||||
return new Promise<void>((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(
|
||||
|
||||
Reference in New Issue
Block a user