mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-04-18 05:23:32 +00:00
remove Write-Warning for CAPIErrors.
Allow them to bubble up. (Might be worth adding a helper function to print stacktrace?)
This commit is contained in:
@@ -137,30 +137,20 @@ Function Get-RemotePotato {
|
||||
|
||||
Function Connect-Voicemeeter {
|
||||
param([String]$Kind)
|
||||
try {
|
||||
switch ($Kind) {
|
||||
"basic" {
|
||||
return Get-RemoteBasic
|
||||
}
|
||||
"banana" {
|
||||
return Get-RemoteBanana
|
||||
}
|
||||
"potato" {
|
||||
return Get-RemotePotato
|
||||
}
|
||||
default { throw [LoginError]::new("Unknown Voicemeeter kind `"$Kind`"") }
|
||||
}
|
||||
}
|
||||
catch [LoginError], [CAPIError] {
|
||||
Write-Warning $_.Exception.ErrorMessage()
|
||||
throw
|
||||
}
|
||||
catch [VMRemoteError] {
|
||||
$_.Exception.ErrorMessage() | Write-Warning
|
||||
if ($_.Exception.ErrorMessage() -eq "Couldn't get Voicemeeter path") {
|
||||
Exit -1
|
||||
switch ($Kind) {
|
||||
"basic" {
|
||||
return Get-RemoteBasic
|
||||
}
|
||||
}
|
||||
"banana" {
|
||||
return Get-RemoteBanana
|
||||
}
|
||||
"potato" {
|
||||
return Get-RemotePotato
|
||||
}
|
||||
default {
|
||||
throw [LoginError]::new("Unknown Voicemeeter kind `"$Kind`"")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Function Disconnect-Voicemeeter {
|
||||
|
||||
Reference in New Issue
Block a user