feat(Page): introduce url at error message at page.goto (#2174)

Now the error message will come with the url where the error was
generated.

Fixes #2165.
This commit is contained in:
Juan Sebastian velez Posada
2018-03-12 18:38:05 -04:00
committed by Andrey Lushnikov
parent 826fe42c48
commit 52d3bc05de
2 changed files with 11 additions and 1 deletions

View File

@@ -518,7 +518,7 @@ class Page extends EventEmitter {
async function navigate(client, url, referrer) {
try {
const response = await client.send('Page.navigate', {url, referrer});
return response.errorText ? new Error(response.errorText) : null;
return response.errorText ? new Error(`${response.errorText} at ${url}`) : null;
} catch (error) {
return error;
}