From 4ba583420ae048d89a941040ec7b26fa144449b6 Mon Sep 17 00:00:00 2001 From: simultsop <22407+simultsop@users.noreply.github.com> Date: Fri, 24 Jun 2022 18:47:18 +0200 Subject: [PATCH] refactor: reject with Error object (#319) * refactor: reject with Error object * fix: use error constructor Co-authored-by: Matt Forster --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 025722c..d79d556 100644 --- a/src/index.js +++ b/src/index.js @@ -130,7 +130,7 @@ class FtpServer extends EventEmitter { delete this.connections[id]; setTimeout(() => { - reject('Timed out disconnecting client') + reject(new Error('Timed out disconnecting the client')) }, this.options.timeout || 1000) try {