mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-01-18 05:10:48 +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:
parent
8c20c58085
commit
6cc43fa553
@ -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 }
|
||||
|
@ -5,11 +5,9 @@ function Setup_DLL {
|
||||
if ([string]::IsNullOrWhiteSpace($vb_path)) {
|
||||
throw [VMRemoteErrors]::new("ERROR: Couldn't get Voicemeeter path")
|
||||
}
|
||||
else {
|
||||
$dll = Join-Path -Path $vb_path -ChildPath ("VoicemeeterRemote" + `
|
||||
(& { if ([Environment]::Is64BitOperatingSystem) { "64" } else { "" } }) + `
|
||||
".dll")
|
||||
}
|
||||
$dll = Join-Path -Path $vb_path -ChildPath ("VoicemeeterRemote" + `
|
||||
(& { if ([Environment]::Is64BitOperatingSystem) { "64" } else { "" } }) + `
|
||||
".dll")
|
||||
}
|
||||
catch [VMRemoteErrors] {
|
||||
Write-Warning $_.Exception.ErrorMessage()
|
||||
|
Loading…
Reference in New Issue
Block a user