voicemeeter-api-powershell/lib/errors.ps1
onyx-and-iris 94be34b3da added custom error classes
Added CAPI and Login custom error classes.

Cleaned up output when error is thrown.
2021-04-29 20:23:02 +01:00

26 lines
482 B
PowerShell

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
}
}