Skip to content

Commit

Permalink
Add out of range exception handling
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GottZ committed Apr 16, 2024
1 parent 67b0b6d commit f921c55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f921c55

Please sign in to comment.