voicemeeter-api-powershell/lib/errors.ps1

31 lines
587 B
PowerShell
Raw Normal View History

2022-12-18 04:30:51 +00:00
class VMRemoteError : Exception {
[string]$msg
2022-12-18 04:30:51 +00:00
VMRemoteError ([string]$msg) {
$this.msg = $msg
}
[string] ErrorMessage () {
return $this.msg
}
}
2022-12-18 04:30:51 +00:00
class LoginError : VMRemoteError {
LoginError ([string]$msg) : base ([string]$msg) {
}
}
2022-12-18 04:30:51 +00:00
class CAPIError : VMRemoteError {
[int]$retval
[string]$caller
CAPIError ([int]$retval, [string]$caller) {
$this.retval = $retval
$this.caller = $caller
}
[string] ErrorMessage () {
2022-12-18 04:30:51 +00:00
return "CAPI return value: {0} in {1}" -f $this.retval, $this.caller
}
}