things
This commit is contained in:
@@ -51,10 +51,11 @@ function Download-YTDLP {
|
||||
}
|
||||
|
||||
# 1. Execute yt-dlp using the call operator (&) and passing the arguments array (@)
|
||||
& $ytDlpPath $arguments
|
||||
$output = & $ytDlpPath @arguments 2>&1
|
||||
$exitCode = $LASTEXITCODE
|
||||
|
||||
# 2. CRITICAL: Check the Exit Code immediately after execution
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
if ($exitCode -ne 0) {
|
||||
# If the exit code is not 0, we throw a terminating exception.
|
||||
# This exception will be caught by your external try/catch block!
|
||||
$ErrorMessage = "yt-dlp failed (Exit Code: $($LASTEXITCODE)). Check standard error output for details."
|
||||
|
||||
Reference in New Issue
Block a user