-
Notifications
You must be signed in to change notification settings - Fork 28
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
Set-SafeguardPatch and Install-SafeguardPatch return JSON string but don't throw exceptions for errors #280
Comments
This is probably because they use a custom web request client. That change was made to support progress and better upload UX. I think there is probably a way to get these cmdlets to throw proper exceptions, and they should if we can do it. |
Fixed in 6.8.568-pre. |
@JeffHarkavy please verify this in the latest 6.8 prerelease. Thanks! |
@petrsnd , @JeffHarkavy , @Goelrachit
The change you are referring to is PR #200, “ Regardless of all of that, the current question at hand:
has not been addressed. This commit, from PR #295 does not address the question. That commit just rethrows an exception when one has already happened, instead of returning any JSON data. In the case of the “Separate OS Patches” and “Patch Preconditions”, the server will return a successful HTTP 200 status code even when there are errors to the “Patch Preconditions”. Here is an example of In that example, we are trying to upload/stage an LTS patch to a Safeguard that is current already on a feature branch. You cannot patch from a feature branch to an LTS branch. That test is done with a “Patch Precondition” check. In this case, with the Note that with the latest code from PR #295, the behavior is exactly the same: With the Here we can see that the server already knows that the patch can’t be applied, but we go ahead and ask the user if they still want to distribute it. A few things need to be done.
And here is the code from the
|
This may be intentional?
When excuting either Set- or Install-SafegaurdPatch if the staging returns anyting in Errors or Warnings the command still "succeeds" without and exception being raised. While this might make sense for Warnings, should we be throwing an exception when Errors are detected? Perhaps use the absence/presenceof the -Force option to throw/not throw?
The text was updated successfully, but these errors were encountered: