diff --git a/lighthouse-core/gather/gather-runner.js b/lighthouse-core/gather/gather-runner.js index 3091ac8fdd4f..16ef1a3bc43b 100644 --- a/lighthouse-core/gather/gather-runner.js +++ b/lighthouse-core/gather/gather-runner.js @@ -132,10 +132,12 @@ class GatherRunner { * Test any error output from the promise, absorbing non-fatal errors and * throwing on fatal ones so that run is stopped. * @param {!Promise<*>} promise + * @param {!string} gathererName * @return {!Promise<*>} */ - static recoverOrThrow(promise) { + static recoverOrThrow(promise, gathererName) { return promise.catch(err => { + log.warn(gathererName, `Caught exception: ${err.message}`); if (err.fatal) { throw err; } @@ -178,7 +180,7 @@ class GatherRunner { return chain.then(_ => { const artifactPromise = Promise.resolve().then(_ => gatherer.beforePass(options)); gathererResults[gatherer.name] = [artifactPromise]; - return GatherRunner.recoverOrThrow(artifactPromise); + return GatherRunner.recoverOrThrow(artifactPromise, gatherer.name); }); }, pass); } @@ -196,8 +198,8 @@ class GatherRunner { const gatherers = config.gatherers; const gatherernames = gatherers.map(g => g.name).join(', '); - const status = 'Loading page & waiting for onload'; - log.log('status', status, gatherernames); + const status = 'Loading page & waiting for idle'; + log.log('status', status, `Collecting data for ${gatherernames}`); const pass = GatherRunner.loadPage(driver, options).then(_ => { log.log('statusEnd', status); @@ -207,7 +209,7 @@ class GatherRunner { return chain.then(_ => { const artifactPromise = Promise.resolve().then(_ => gatherer.pass(options)); gathererResults[gatherer.name].push(artifactPromise); - return GatherRunner.recoverOrThrow(artifactPromise); + return GatherRunner.recoverOrThrow(artifactPromise, gatherer.name); }); }, pass); } @@ -264,7 +266,7 @@ class GatherRunner { log.log('status', status); const artifactPromise = Promise.resolve().then(_ => gatherer.afterPass(options, passData)); gathererResults[gatherer.name].push(artifactPromise); - return GatherRunner.recoverOrThrow(artifactPromise); + return GatherRunner.recoverOrThrow(artifactPromise, gatherer.name); }).then(_ => { log.verbose('statusEnd', status); }); diff --git a/lighthouse-core/runner.js b/lighthouse-core/runner.js index 296304decfab..72fd6daa4f70 100644 --- a/lighthouse-core/runner.js +++ b/lighthouse-core/runner.js @@ -93,6 +93,12 @@ class Runner { return artifacts; }); + + run = run.then(artifacts => { + log.log('status', 'Analyzing and running audits...'); + return artifacts; + }); + // Run each audit sequentially, the auditResults array has all our fine work const auditResults = []; for (const audit of config.audits) { @@ -125,6 +131,8 @@ class Runner { // Format and aggregate results before returning. run = run .then(runResults => { + log.log('status', 'Generating results...'); + const resultsById = runResults.auditResults.reduce((results, audit) => { results[audit.name] = audit; return results; @@ -202,6 +210,7 @@ class Runner { // Fill remaining audit result fields. }).then(auditResult => Audit.generateAuditResult(audit, auditResult)) .catch(err => { + log.warn(audit.meta.name, `Caught exception: ${err.message}`); if (err.fatal) { throw err; }