Skip to content

Commit

Permalink
fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Dec 3, 2024
1 parent 7aee39d commit 973055d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/computed/network-analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

import log from 'lighthouse-logger';

import * as Lantern from '../lib/lantern/lantern.js';
import {makeComputedArtifact} from './computed-artifact.js';
import {NetworkRecords} from './network-records.js';
Expand All @@ -18,7 +20,13 @@ class NetworkAnalysis {
const records = await NetworkRecords.request(devtoolsLog, context);
const analysis = Lantern.Core.NetworkAnalyzer.analyze(records);
if (!analysis) {
throw new Error('Could not compute network analysis');
log.error('NetworkAnalysis', 'Network analysis failed due to lack of transfer data');
return {
throughput: 0,
rtt: Number.POSITIVE_INFINITY,
additionalRttByOrigin: new Map(),
serverResponseTimeByOrigin: new Map(),
};
}
return analysis;
}
Expand Down

0 comments on commit 973055d

Please sign in to comment.