MM-62371 Add additional error handling to PerformanceReporter (#29774)
As in the comments I added, this is to fix an error introduced by changes made by either Firefox or 1Password due to accessing a performance metric's details field when we're not allowed to.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4265df8a07
Коммит
e7c583f312
@@ -196,7 +196,16 @@ export default class PerformanceReporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private handleMeasure(entry: PerformanceMeasure) {
|
private handleMeasure(entry: PerformanceMeasure) {
|
||||||
if (!entry.detail?.report) {
|
let report;
|
||||||
|
try {
|
||||||
|
report = Boolean(entry.detail?.report);
|
||||||
|
} catch {
|
||||||
|
// Measures recorded by browser extensions may be in a separate context which causes accessing
|
||||||
|
// entry.detail to throw an error
|
||||||
|
report = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!report) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,7 +218,16 @@ export default class PerformanceReporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private handleMark(entry: PerformanceMeasure) {
|
private handleMark(entry: PerformanceMeasure) {
|
||||||
if (!entry.detail?.report) {
|
let report;
|
||||||
|
try {
|
||||||
|
report = Boolean(entry.detail?.report);
|
||||||
|
} catch {
|
||||||
|
// Measures recorded by browser extensions may be in a separate context which causes accessing
|
||||||
|
// entry.detail to throw an error
|
||||||
|
report = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!report) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user