refactor: reject with Error object (#319)

* refactor: reject with Error object

* fix: use error constructor

Co-authored-by: Matt Forster <hey@mattforster.ca>
This commit is contained in:
simultsop
2022-06-24 18:47:18 +02:00
committed by GitHub
parent 51049f631a
commit 4ba583420a

View File

@@ -130,7 +130,7 @@ class FtpServer extends EventEmitter {
delete this.connections[id]; delete this.connections[id];
setTimeout(() => { setTimeout(() => {
reject('Timed out disconnecting client') reject(new Error('Timed out disconnecting the client'))
}, this.options.timeout || 1000) }, this.options.timeout || 1000)
try { try {