mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-04-18 05:23:32 +00:00
changes to login error handling.
throw capi error if retval not 1 or -2. exit from program if login/capi error thrown.
This commit is contained in:
@@ -41,10 +41,11 @@ function Login {
|
||||
elseif ($retval -eq -2) {
|
||||
throw [LoginError]::new('Login may only be called once per session')
|
||||
}
|
||||
else { exit }
|
||||
else { throw [CAPIError]::new($retval, $MyInvocation.MyCommand) }
|
||||
}
|
||||
catch [LoginError], [CAPIError] {
|
||||
Write-Warning $_.Exception.ErrorMessage()
|
||||
exit
|
||||
}
|
||||
|
||||
while (P_Dirty -or M_Dirty) { Start-Sleep -m 1 }
|
||||
|
||||
Reference in New Issue
Block a user