添加更多异常处理

This commit is contained in:
Harvey Zack committed 2018-12-05 16:09:37 +08:00
1 parent 6d3e0b4567
commit 156519546f
2 files changed
+19 -4

No files matched your search

@@ -73,6 +73,7 @@ class ArtplayerToolThumbnail extends Emitter {
this.emit('video', this.video);
})
.catch(err => {
this.emit('error', err.message);
console.error(err);
});
}
@@ -104,17 +105,21 @@ class ArtplayerToolThumbnail extends Emitter {
});
this.processing = true;
runPromisesInSeries(promiseList)
.then(() => {
.then(() =>
sleep(delay * 2)
.then(() => {
this.processing = false;
this.emit('done');
})
.catch(err => {
this.processing = false;
this.emit('error', err.message);
console.error(err);
});
})
}),
)
.catch(err => {
this.processing = false;
this.emit('error', err.message);
console.error(err);
});
}