chore: update aegir (#1027)

Updates aegir, fixes all new linting errors.
This commit is contained in:
Alex Potsides
2021-11-19 08:02:24 +00:00
committed by GitHub
parent 3fb424914f
commit 3bed7b4cb2
39 changed files with 104 additions and 102 deletions

View File

@ -106,7 +106,7 @@ class Upgrader {
} else {
upgradedConn = encryptedConn
}
} catch (err) {
} catch (/** @type {any} */ err) {
log.error('Failed to upgrade inbound connection', err)
await maConn.close(err)
throw err
@ -181,7 +181,7 @@ class Upgrader {
} else {
upgradedConn = encryptedConn
}
} catch (err) {
} catch (/** @type {any} */ err) {
log.error('Failed to upgrade outbound connection', err)
await maConn.close(err)
throw err
@ -245,7 +245,7 @@ class Upgrader {
if (this.metrics) this.metrics.trackStream({ stream, remotePeer, protocol })
connection.addStream(muxedStream, { protocol })
this._onStream({ connection, stream: { ...muxedStream, ...stream }, protocol })
} catch (err) {
} catch (/** @type {any} */ err) {
log.error(err)
}
},
@ -263,7 +263,7 @@ class Upgrader {
const { stream, protocol } = await mss.select(protocols)
if (this.metrics) this.metrics.trackStream({ stream, remotePeer, protocol })
return { stream: { ...muxedStream, ...stream }, protocol }
} catch (err) {
} catch (/** @type {any} */ err) {
log.error('could not create new stream', err)
throw errCode(err, codes.ERR_UNSUPPORTED_PROTOCOL)
}
@ -283,7 +283,7 @@ class Upgrader {
if (connection.stat.status === 'open') {
await connection.close()
}
} catch (err) {
} catch (/** @type {any} */ err) {
log.error(err)
} finally {
this.onConnectionEnd(connection)
@ -371,7 +371,7 @@ class Upgrader {
...await crypto.secureInbound(localPeer, stream),
protocol
}
} catch (err) {
} catch (/** @type {any} */ err) {
throw errCode(err, codes.ERR_ENCRYPTION_FAILED)
}
}
@ -406,7 +406,7 @@ class Upgrader {
...await crypto.secureOutbound(localPeer, stream, remotePeerId),
protocol
}
} catch (err) {
} catch (/** @type {any} */ err) {
throw errCode(err, codes.ERR_ENCRYPTION_FAILED)
}
}
@ -430,7 +430,7 @@ class Upgrader {
log('%s selected as muxer protocol', protocol)
const Muxer = muxers.get(protocol)
return { stream, Muxer }
} catch (err) {
} catch (/** @type {any} */ err) {
throw errCode(err, codes.ERR_MUXER_UNAVAILABLE)
}
}
@ -453,7 +453,7 @@ class Upgrader {
const { stream, protocol } = await listener.handle(protocols)
const Muxer = muxers.get(protocol)
return { stream, Muxer }
} catch (err) {
} catch (/** @type {any} */ err) {
throw errCode(err, codes.ERR_MUXER_UNAVAILABLE)
}
}