mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: apply timeout to waiting for a response (#12142)
This commit is contained in:
parent
00fa75ec9e
commit
ac1767da0b
@ -230,7 +230,13 @@ export class CdpFrame extends Frame {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
return await watcher.navigationResponse();
|
||||
const result = await Deferred.race<
|
||||
Error | HTTPResponse | null | undefined
|
||||
>([watcher.terminationPromise(), watcher.navigationResponse()]);
|
||||
if (result instanceof Error) {
|
||||
throw error;
|
||||
}
|
||||
return result || null;
|
||||
} finally {
|
||||
watcher.dispose();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user