provider/azure: Provide a simpler error when using a Platform Image without a Storage Service #2861
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, when attempting to use a Platform Image without a Storage Service, you get a cryptic and misleading error:
The error is originating here:
But we're swallowing that specific error and returning a more generic one here:
This obfuscates what the underlying problem is and the user can't self-diagnose and correct.
My patch does a few things, and we can pick what we like:
errors
file to consolidate some common errors, but only has aPlatformStorageError
for nowPlatformStorageError
afterretrieveOSImageDetails
, and returns that error afterwardsNew output:
I've introduced the specific errors here to help trap any errors thrown but also maintain the current fall-through flow in
retrieveImageDetails
(ifretrieveVMImageDetails
errors, then still tryretrieveOSImageDetails
, and error at the end).