From 6c31ac3040d55025e3e0eca9da7d655f47913ed9 Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Thu, 2 Sep 2021 11:06:23 +0200 Subject: [PATCH] swap bad command and invalid token errors --- index.js | 2 +- lib/errors.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index a94845b..bf50686 100644 --- a/index.js +++ b/index.js @@ -582,8 +582,8 @@ class DHT extends EventEmitter { } DHT.ERROR_UNKNOWN_COMMAND = UNKNOWN_COMMAND -DHT.ERROR_BAD_COMMAND = BAD_COMMAND DHT.ERROR_INVALID_TOKEN = INVALID_TOKEN +DHT.ERROR_BAD_COMMAND = BAD_COMMAND module.exports = DHT diff --git a/lib/errors.js b/lib/errors.js index 6e6a08d..79141e0 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -1,6 +1,6 @@ exports.UNKNOWN_COMMAND = 1 -exports.BAD_COMMAND = 2 -exports.INVALID_TOKEN = 3 +exports.INVALID_TOKEN = 2 +exports.BAD_COMMAND = 3 exports.TIMEOUT = new Error('Request timed out') exports.TIMEOUT.code = 'ETIMEDOUT'