fix: unhandled rejection case

This commit is contained in:
Yanlong Wang 2025-02-14 17:59:18 +08:00
parent 0b93e7da53
commit 05df989202
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -886,6 +886,7 @@ export class PuppeteerControl extends AsyncService {
}
let nextSnapshotDeferred = Defer();
nextSnapshotDeferred.promise.catch(()=> 'just dont crash anything');
const crippleListener = () => nextSnapshotDeferred.reject(new ServiceCrashedError({ message: `Browser crashed, try again` }));
this.once('crippled', crippleListener);
nextSnapshotDeferred.promise.finally(() => {