diff --git a/pkg/skaffold/build/docker/errors.go b/pkg/skaffold/build/docker/errors.go index 1e1b8f7fa93..0f9c29570fb 100644 --- a/pkg/skaffold/build/docker/errors.go +++ b/pkg/skaffold/build/docker/errors.go @@ -35,7 +35,7 @@ func newBuildError(err error) error { switch errU.(type) { case *jsonmessage.JSONError: - return sErrors.NewError( + return sErrors.NewError(err, proto.ActionableErr{ Message: err.Error(), ErrCode: proto.StatusCode_BUILD_USER_ERROR, @@ -47,7 +47,7 @@ func newBuildError(err error) error { }, }) default: - return sErrors.NewError( + return sErrors.NewError(err, proto.ActionableErr{ Message: errU.Error(), ErrCode: getErrorCode(errU), @@ -93,7 +93,7 @@ func getErrorCode(err error) proto.StatusCode { } func dockerfileNotFound(err error, artifact string) error { - return sErrors.NewError( + return sErrors.NewError(err, proto.ActionableErr{ Message: err.Error(), ErrCode: proto.StatusCode_BUILD_DOCKERFILE_NOT_FOUND, @@ -108,7 +108,7 @@ func dockerfileNotFound(err error, artifact string) error { } func cacheFromPullErr(err error, artifact string) error { - return sErrors.NewError( + return sErrors.NewError(err, proto.ActionableErr{ Message: err.Error(), ErrCode: proto.StatusCode_BUILD_DOCKER_CACHE_FROM_PULL_ERR, diff --git a/pkg/skaffold/errors/err_def.go b/pkg/skaffold/errors/err_def.go index c0797da9305..d648f59a264 100644 --- a/pkg/skaffold/errors/err_def.go +++ b/pkg/skaffold/errors/err_def.go @@ -30,7 +30,6 @@ type Error interface { Error() string StatusCode() proto.StatusCode Suggestions() []*proto.Suggestion -<<<<<<< HEAD Unwrap() error } @@ -50,17 +49,6 @@ func (e ErrDef) Unwrap() error { return e.err } -type ErrDef struct { - ae proto.ActionableErr -} - -func (e ErrDef) Error() string { - if s := concatSuggestions(e.Suggestions()); s != "" { - return fmt.Sprintf("%s. %s", e.ae.Message, concatSuggestions(e.Suggestions())) - } - return e.ae.Message -} - func (e ErrDef) StatusCode() proto.StatusCode { return e.ae.ErrCode } @@ -80,4 +68,4 @@ func NewErrorWithStatusCode(ae proto.ActionableErr) ErrDef { return ErrDef{ ae: ae, } -} +} \ No newline at end of file