Поправлен неверный вызов reject

This commit is contained in:
Book Pauk
2020-12-05 01:11:31 +07:00
parent e25375fb7a
commit 0d87043f91
3 changed files with 5 additions and 5 deletions

View File

@@ -28,7 +28,7 @@ class LimitedQueue {
get(onPlaceChange) {
return new Promise((resolve, reject) => {
if (this.destroyed)
reject('destroyed');
reject(new Error('destroyed'));
const take = () => {
if (this.freed <= 0)
@@ -73,7 +73,7 @@ class LimitedQueue {
if (onPlaceChange)
onPlaceChange(this.listeners.length);
} else {
reject('Превышен размер очереди ожидания');
reject(new Error('Превышен размер очереди ожидания'));
}
}
});