From f921c55ae73f14389027908f20de3e9d5e6fb318 Mon Sep 17 00:00:00 2001 From: Jan-Stefan Janetzky Date: Tue, 16 Apr 2024 20:05:05 +0200 Subject: [PATCH] Add out of range exception handling Added a new case in the switch statement to handle -3 return value. This will throw an "out of range" exception when the parameter is outside the acceptable limits. --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index db694fd..74a1cac 100644 --- a/index.js +++ b/index.js @@ -177,6 +177,10 @@ const voicemeeter = { // re-run this function to re-connect. will throw if not possible. return voicemeeter.getRawParameterFloat(parameter); } + case -3: { + // out of range exception + throw "Parameter out of range"; + } default: { console.error("unknown return value", retval);