mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Fail navigation when main resource fails to load
This patch fails navigation when the main resource fails to load. Fixes #148.
This commit is contained in:
@@ -260,7 +260,10 @@ class Page extends EventEmitter {
|
||||
}
|
||||
await result;
|
||||
helper.removeEventListeners([listener]);
|
||||
return responses.get(this.mainFrame().url());
|
||||
let response = responses.get(this.mainFrame().url());
|
||||
if (!response)
|
||||
throw new Error('Failed to navigate: ' + url);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user