Skip to content
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: handle Invoke-Installer errors #1199

Merged
merged 1 commit into from
Jul 11, 2024
Merged

fix: handle Invoke-Installer errors #1199

merged 1 commit into from
Jul 11, 2024

Conversation

mistydemeo
Copy link
Contributor

@mistydemeo mistydemeo commented Jul 9, 2024

We hadn't set the error types we wanted from the core file management functions here, so they were continuing after an error instead of throwing so we could terminate early.

Prior to dec41f6 this was handled by explicitly setting $ErrorActionPreference before and after calling Invoke-Installer. We removed that when reworking some errors, but we didn't update individual calls within Invoke-Installer to ensure they still stopped on error.

Fixes #1183.

Copy link
Contributor

@Gankra Gankra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you able to test this?

@mistydemeo
Copy link
Contributor Author

mistydemeo commented Jul 10, 2024

image

I tested by reproducing the empty artifact, looks like I accidentally swallowed the original error message. I'll fix that.

We hadn't set the error types we wanted from the core file management
functions here, so they were continuing after an error instead of
throwing so we could terminate early.

Prior to dec41f6 this was handled
by explicitly setting $ErrorActionPreference before and after
calling Invoke-Installer. We removed that when reworking some errors,
but we didn't update individual calls within Invoke-Installer to ensure
they still stopped on error.
@Gankra
Copy link
Contributor

Gankra commented Jul 10, 2024

We already have a global try-catch on the script, not clear what adding this extra interim catch does, tbh

@mistydemeo
Copy link
Contributor Author

Yeah, fair enough. I can drop it, just felt that a little extra info on what step failed gives more context on the exception.

@Gankra Gankra merged commit 4f6c91a into main Jul 11, 2024
16 checks passed
@Gankra Gankra deleted the fix-ps1-errors branch July 11, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

powershell installer does not fail when artifact is missing file
2 participants