From: Jérôme Benoit Date: Sun, 2 Jul 2023 22:37:00 +0000 (+0200) Subject: refactor: refine error type in helper X-Git-Tag: v1.2.18~84 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7c2c6fd37881dd238855cae4a0d0a21d0d44111a;p=e-mobility-charging-stations-simulator.git refactor: refine error type in helper Signed-off-by: Jérôme Benoit --- diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 647edcb9..fb449213 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -166,7 +166,7 @@ export class Utils { scale = 2 ): number { if (fluctuationPercent < 0 || fluctuationPercent > 100) { - throw new Error( + throw new RangeError( `Fluctuation percent must be between 0 and 100. Actual value: ${fluctuationPercent}` ); }