From ccaa545d362e336d8a57b4da51e7e947adb3d972 Mon Sep 17 00:00:00 2001 From: Brian de Alwis Date: Fri, 23 Apr 2021 22:13:09 -0400 Subject: [PATCH] Do not swallow parsing errors --- pkg/skaffold/schema/errors/errors.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/skaffold/schema/errors/errors.go b/pkg/skaffold/schema/errors/errors.go index c301b9e0c05..f7fce25a249 100644 --- a/pkg/skaffold/schema/errors/errors.go +++ b/pkg/skaffold/schema/errors/errors.go @@ -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, }) } @@ -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{ { @@ -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{ { @@ -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{ { @@ -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, }) } @@ -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, }) }