mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-01-18 13:20:47 +00:00
94be34b3da
Added CAPI and Login custom error classes. Cleaned up output when error is thrown.
26 lines
482 B
PowerShell
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
|
|
}
|
|
}
|