fix: make error codes consistent (#1054)

Sometimes they are `NOT_FOUND`, sometimes `ERR_NOT_FOUND`, etc.

Move all error codes into `errors.js` and reference them from there.
This commit is contained in:
Alex Potsides
2021-12-07 14:42:10 +00:00
committed by GitHub
parent cbaa5a2ef3
commit b25e0fe531
9 changed files with 73 additions and 48 deletions

View File

@ -297,7 +297,7 @@ class Upgrader {
maConn.timeline.upgraded = Date.now()
const errConnectionNotMultiplexed = () => {
throw errCode(new Error('connection is not multiplexed'), 'ERR_CONNECTION_NOT_MULTIPLEXED')
throw errCode(new Error('connection is not multiplexed'), codes.ERR_CONNECTION_NOT_MULTIPLEXED)
}
// Create the connection