GoogleContainerTools / GoogleContainerTools/skaffold

Support Mutiple errors codes in Error Framework.

Open
#5,128 1 comment 0 reactions 0 assignees View on GitHub
area/errors kind/friction priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

In #5088 @zedfmario added validation for docker network container.
In this PR, the validation process validates all fields and throws multiple errors.

Each of these errors could be distinct.

As of now, i could think are two was to address this concern.
1. Should we drop having distinct error codes for schema validation and instead user an umbrella code `INIT_INVALID_SKAFFOLD_CONFIG` ?

e.g.
```
sErrors.MergeErrors(errCode proto.StatusCode, errs []proto.ActionableError) error {
return ErrDef{
ae: proto.ActionableErr{
Message: strings.Join(errs.Message, "\n"), // Join all proto.ActionableError.Message
ErrCode: errCode
Suggestions: append(s, errs.Suggestions..) // Append all suggestions.
}
}
)
```

2. Or wrap multiple []Errdef into an `error` type and change `ShowAIError` to support cases where a []ErrDef can be wrapped inside an error.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.