From b1bd4a1576a894947da22f363c4737ffc218f8d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 29 Nov 2023 11:08:43 +0100 Subject: [PATCH] fix: ignore harmless performance error at shutdown MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/performance/PerformanceStatistics.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/performance/PerformanceStatistics.ts b/src/performance/PerformanceStatistics.ts index b7bc5d27..94c189e4 100644 --- a/src/performance/PerformanceStatistics.ts +++ b/src/performance/PerformanceStatistics.ts @@ -78,7 +78,15 @@ export class PerformanceStatistics { } public static endMeasure(name: string, markId: string): void { - performance.measure(name, markId); + try { + performance.measure(name, markId); + } catch (error) { + if (error instanceof Error && error.message.includes('performance mark has not been set')) { + /** Ignore */ + } else { + throw error; + } + } performance.clearMarks(markId); performance.clearMeasures(name); } -- 2.34.1