Skip to content

Commit afb3bd6

Browse files
Adam RaineDevtools-frontend LUCI CQ
authored andcommitted
[DocumentLatency] Issue warning for missing document
Some pages like the Chrome new tab page won't have a main document. Bug: 392039091 Change-Id: Ic02bf47dfb064b882bc3216ca8f72ac046955b37 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6202994 Auto-Submit: Adam Raine <[email protected]> Commit-Queue: Adriana Ixba <[email protected]> Commit-Queue: Adam Raine <[email protected]> Reviewed-by: Adriana Ixba <[email protected]>
1 parent 221baca commit afb3bd6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

front_end/models/trace/insights/DocumentLatency.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ import * as i18n from '../../../core/i18n/i18n.js';
66
import * as Helpers from '../helpers/helpers.js';
77
import * as Types from '../types/types.js';
88

9-
import {InsightCategory, type InsightModel, type InsightSetContext, type RequiredData} from './types.js';
9+
import {
10+
InsightCategory,
11+
type InsightModel,
12+
type InsightSetContext,
13+
InsightWarning,
14+
type RequiredData
15+
} from './types.js';
1016

1117
const UIStrings = {
1218
/**
@@ -145,7 +151,7 @@ export function generateInsight(
145151
const documentRequest =
146152
parsedTrace.NetworkRequests.byTime.find(req => req.args.data.requestId === context.navigationId);
147153
if (!documentRequest) {
148-
throw new Error('missing document request');
154+
return finalize({warnings: [InsightWarning.NO_DOCUMENT_REQUEST]});
149155
}
150156

151157
const serverResponseTime = getServerResponseTime(documentRequest);

0 commit comments

Comments
 (0)