Skip to content

Commit 0757c2d

Browse files
author
Michael Mrowetz
committed
#224 throw error if startedDateTime is missing in HAR
1 parent e2d0afc commit 0757c2d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/ts/transformers/har.ts

+3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ export function transformPage(harData: Har | Log,
100100

101101
const pages = getPages(data);
102102
const currPage = pages[pageIndex];
103+
if (!currPage.startedDateTime) {
104+
throw new TypeError(`Invalid HAR document: "log.pages[${pageIndex}].startedDateTime" is not set`);
105+
}
103106
const pageStartTime = new Date(currPage.startedDateTime).getTime();
104107
const pageTimings = currPage.pageTimings;
105108

0 commit comments

Comments
 (0)