Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tejal29 committed Nov 30, 2020
1 parent 75862c2 commit d85b932
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
8 changes: 4 additions & 4 deletions pkg/skaffold/build/docker/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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),
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
14 changes: 1 addition & 13 deletions pkg/skaffold/errors/err_def.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ type Error interface {
Error() string
StatusCode() proto.StatusCode
Suggestions() []*proto.Suggestion
<<<<<<< HEAD
Unwrap() error
}

Expand All @@ -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
}
Expand All @@ -80,4 +68,4 @@ func NewErrorWithStatusCode(ae proto.ActionableErr) ErrDef {
return ErrDef{
ae: ae,
}
}
}

0 comments on commit d85b932

Please sign in to comment.