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

Provide helpful error message if users try to manipulate packages without specifying any #79

Merged
merged 1 commit into from
Dec 4, 2017

Conversation

HowardWolosky
Copy link
Member

If a user tries to use -AddPackages or -ReplacePackages with a StoreBroker payload
that doesn't contain any, they end up with a literal null entry in the applicationPackages
list due to how we manipulate the submission object. This then results in an error with the API.

We should actually be catching this scenario during patching time, and providing users a helpful
error message letting them know that they should check their input parameters to New-SubmissionPackage
so that they know how to recover.

$output += "Please check your input settings to New-SubmissionPackage and ensure you're providing a value for AppxPath."
$output = $output -join [Environment]::NewLine
Write-Log $output -Level Error
throw $output
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do this with a helper method?

Copy link
Member Author

Choose a reason for hiding this comment

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

A helper method wouldn't buy us much here. It's a conditional that throws a message. The only thing that I could see realistically to share out would be the error message, but at this time, I don't see sufficient value for moving it to a common place when only being shared by these two instances. Good suggestion, but won't fix.

…hout specifying any

If a user tries to use `-AddPackages` or `-ReplacePackages` with a StoreBroker payload
that doesn't contain any, they end up with a literal `null` entry in the `applicationPackages`
list due to how we manipulate the submission object.  This then results in an error with the API.

We should actually be catching this scenario during patching time, and providing users a helpful
error message letting them know that they should check their input parameters to `New-SubmissionPackage`
so that they know how to recover.
@HowardWolosky HowardWolosky merged commit e1aa2d3 into microsoft:master Dec 4, 2017
@HowardWolosky HowardWolosky deleted the noPackages branch December 4, 2017 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants