-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to stop all updates when only one app failed to update. #3628
Conversation
When update all apps, only one app failed to update, it terminates and stops other apps' update. Fix this problem to add try-catch statement
# $outdated is a list of ($app, $global) tuples | ||
$outdated | ForEach-Object { update @_ $quiet $independent $suggested $use_cache $check_hash } | ||
$outdated | ForEach-Object { try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$outdated | ForEach-Object { try { | |
$outdated | ForEach-Object { | |
try { |
$outdated | ForEach-Object { try { | ||
update @_ $quiet $independent $suggested $use_cache $check_hash | ||
} catch { | ||
Write-Error $_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write-Error $_ | |
error $_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you want to show in this error? Name of manifest or error message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want show error including error message for report issue.
I do not think this will work as there are |
# File B.ps1
function Abort-Mock {
write-host 'before calling exit'
exit 1
}
# File A.ps1
. $psscriptroot\B.ps1
try {
Abort-Mock
} catch {
'ahoj'
}
Write-host 'after exit call' Result is always only message "Before calling exit" |
Thanks to review. I can't find some way to trap or catch |
I am just saying that this will not fix problem when there is some hash check fail or installation error. Because on hash check fail there is |
Good description. I checked codes to find error I met. Found it If found new version app, scoop try download it using This changes fix above problem. However I feels this pr is not right way. Why |
No description provided.