From: Jérôme Benoit Date: Wed, 29 Nov 2023 10:08:43 +0000 (+0100) Subject: fix: ignore harmless performance error at shutdown X-Git-Tag: v1.2.27~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b1bd4a1576a894947da22f363c4737ffc218f8d8;p=e-mobility-charging-stations-simulator.git fix: ignore harmless performance error at shutdown Signed-off-by: Jérôme Benoit --- 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); }