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

Do not swallow parsing errors #5722

Merged
merged 1 commit into from
Apr 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pkg/skaffold/schema/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
func ConfigParsingError(err error) error {
return sErrors.NewError(err,
proto.ActionableErr{
Message: "error parsing skaffold configuration file",
Message: fmt.Sprintf("error parsing skaffold configuration file: %v", err),
ErrCode: proto.StatusCode_CONFIG_FILE_PARSING_ERR,
})
}
Expand All @@ -36,7 +36,7 @@ func ConfigParsingError(err error) error {
func MainConfigFileNotFoundErr(file string, err error) error {
return sErrors.NewError(err,
proto.ActionableErr{
Message: fmt.Sprintf("unable to find configuration file %q", file),
Message: fmt.Sprintf("unable to find configuration file %q: %v", file, err),
ErrCode: proto.StatusCode_CONFIG_FILE_NOT_FOUND_ERR,
Suggestions: []*proto.Suggestion{
{
Expand All @@ -51,7 +51,7 @@ func MainConfigFileNotFoundErr(file string, err error) error {
func DependencyConfigFileNotFoundErr(depFile, parentFile string, err error) error {
return sErrors.NewError(err,
proto.ActionableErr{
Message: fmt.Sprintf("could not find skaffold config file %q that is referenced as a dependency in config file %q", depFile, parentFile),
Message: fmt.Sprintf("could not find skaffold config file %q that is referenced as a dependency in config file %q: %v", depFile, parentFile, err),
ErrCode: proto.StatusCode_CONFIG_DEPENDENCY_NOT_FOUND_ERR,
Suggestions: []*proto.Suggestion{
{
Expand Down Expand Up @@ -124,7 +124,7 @@ func DuplicateConfigNamesAcrossFilesErr(config, file1, file2 string) error {
func ConfigProfileActivationErr(config, file string, err error) error {
return sErrors.NewError(err,
proto.ActionableErr{
Message: fmt.Sprintf("failed to apply profiles to config %q defined in file %q", config, file),
Message: fmt.Sprintf("failed to apply profiles to config %q defined in file %q: %v", config, file, err),
ErrCode: proto.StatusCode_CONFIG_APPLY_PROFILES_ERR,
Suggestions: []*proto.Suggestion{
{
Expand All @@ -139,7 +139,7 @@ func ConfigProfileActivationErr(config, file string, err error) error {
func ConfigSetDefaultValuesErr(config, file string, err error) error {
return sErrors.NewError(err,
proto.ActionableErr{
Message: fmt.Sprintf("failed to set default values for config %q defined in file %q", config, file),
Message: fmt.Sprintf("failed to set default values for config %q defined in file %q: %v", config, file, err),
ErrCode: proto.StatusCode_CONFIG_DEFAULT_VALUES_ERR,
})
}
Expand All @@ -148,7 +148,7 @@ func ConfigSetDefaultValuesErr(config, file string, err error) error {
func ConfigSetAbsFilePathsErr(config, file string, err error) error {
return sErrors.NewError(err,
proto.ActionableErr{
Message: fmt.Sprintf("failed to set absolute filepaths for config %q defined in file %q", config, file),
Message: fmt.Sprintf("failed to set absolute filepaths for config %q defined in file %q: %v", config, file, err),
ErrCode: proto.StatusCode_CONFIG_FILE_PATHS_SUBSTITUTION_ERR,
})
}
Expand Down