Skip to content

Commit

Permalink
[Lighthouse] Recover from fatal Lighthouse errors.
Browse files Browse the repository at this point in the history
A previous CL[1] refactored this file, transforming some promise
chaining into a try/catch. However, the final statement that
actually kicks off Lighthouse was not await'd, so any fatal
error is not handled as expected.

Additionally, the same CL dropped the 'close()' no-op method on the
Lighthouse port. This doesn't result in a user-facing error because
Lighthouse dismisses any error that happens during the disconnect
phase, but there is still an error message logged to console, which
is misleading as there really isn't any harm done.

[1] https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2697187
[2] GoogleChrome/lighthouse#13273 (comment)

Bug: 968639
Change-Id: Icf41f3ed8c3cd993f1d9e4748b8aff394c0582a5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3258498
Commit-Queue: Connor Clark <cjamcl@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
  • Loading branch information
Connor Clark authored and Devtools-frontend LUCI CQ committed Nov 3, 2021
1 parent 8388f33 commit 6c6dc45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion front_end/entrypoints/lighthouse_worker/LighthouseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class LighthousePort {
send(message: string): void {
notifyFrontendViaWorkerMessage('sendProtocolMessage', {message});
}
close(): void {
}
}

const port = new LighthousePort();
Expand Down Expand Up @@ -59,7 +61,7 @@ async function start(params: any): Promise<unknown> {
const url = params.url;

// @ts-expect-error /~https://github.com/GoogleChrome/lighthouse/issues/11628
return self.runLighthouse(url, flags, config, connection);
return await self.runLighthouse(url, flags, config, connection);
} catch (err) {
return ({
fatal: true,
Expand Down

0 comments on commit 6c6dc45

Please sign in to comment.