voicemeeter-api-powershell/lib/errors.ps1
onyx-and-iris fbe9fe68cf update to dll loading
Added fetch dll path through registry.

Added custom error class VBPathError in case dll path was not found

Added function Setup_DLL to base.ps1

Wrapper setup stops if setup_dll returns false (no login, no class setup)
2021-05-04 17:29:38 +01:00

38 lines
660 B
PowerShell

class VBPathError : Exception {
[String]$msg
VBPathError([String]$msg) {
$this.msg = $msg
}
[String] ErrorMessage() {
return $this.msg
}
}
class LoginError : Exception {
[String]$msg
LoginError([String]$msg) {
$this.msg = $msg
}
[String] ErrorMessage() {
return $this.msg
}
}
class CAPIError : Exception {
[Int]$retval
[String]$caller
CAPIError([Int]$retval, [String]$caller) {
$this.retval = $retval
$this.caller = $caller
}
[String] ErrorMessage() {
return "ERROR: CAPI return value: {0} in {1}" -f $this.retval, $this.caller
}
}