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.
Description
Seen in #5719, where Skaffold's error message doesn't provide any helpful detail on the source of the error:
parsing skaffold config: failed to apply profiles to config "cryptobot" defined in file "/home/gitlab-runner/builds/ZqTVFjA1/0/high-school-prod/cryptobot/skaffold.yaml". There's an issue with one of the profiles defined in config "cryptobot" in file "/home/gitlab-runner/builds/ZqTVFjA1/0/high-school-prod/cryptobot/skaffold.yaml"; refer to the documentation on how to author valid profiles: https://skaffold.dev/docs/environment/profiles/.
"What is the issue!?" I cried in vain.
It turns out that we're swallowing the errors when generating our actionable error wrappers.
This PR exposes these errors.
As a result, errors like:
now become:
Note: I had thought about changing
ErrDef.Error()
:skaffold/pkg/skaffold/errors/err_def.go
Lines 37 to 41 in 9b59cbc
Except most other actionable error definitions use
fmt.Sprintf("<message>: %v", err)
to inline the error object.