Skip to content

Commit

Permalink
update: Optimize the error message
Browse files Browse the repository at this point in the history
Signed-off-by: wujunwei <wjw3323@live.com>
(cherry picked from commit 4fcec24)
  • Loading branch information
wujunwei authored and mattfarina committed Oct 12, 2022
1 parent f22e260 commit 23ff142
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/chart/dependency.go
Expand Up @@ -54,7 +54,7 @@ type Dependency struct {
// loaded.
func (d *Dependency) Validate() error {
if d == nil {
return ValidationError("the dependency's item can not be nil")
return ValidationError("dependency cannot be an empty list")
}
d.Name = sanitizeString(d.Name)
d.Version = sanitizeString(d.Version)
Expand Down
2 changes: 1 addition & 1 deletion pkg/chart/metadata.go
Expand Up @@ -35,7 +35,7 @@ type Maintainer struct {
// Validate checks valid data and sanitizes string characters.
func (m *Maintainer) Validate() error {
if m == nil {
return ValidationError("the maintainer's item can not be nil")
return ValidationError("maintainer cannot be an empty list")
}
m.Name = sanitizeString(m.Name)
m.Email = sanitizeString(m.Email)
Expand Down
4 changes: 2 additions & 2 deletions pkg/chart/metadata_test.go
Expand Up @@ -82,7 +82,7 @@ func TestValidate(t *testing.T) {
nil,
},
},
ValidationError("the dependency's item can not be nil"),
ValidationError("dependency cannot be an empty list"),
},
{
&Metadata{
Expand All @@ -94,7 +94,7 @@ func TestValidate(t *testing.T) {
nil,
},
},
ValidationError("the maintainer's item can not be nil"),
ValidationError("maintainer cannot be an empty list"),
},
{
&Metadata{APIVersion: "v2", Name: "test", Version: "1.2.3.4"},
Expand Down

0 comments on commit 23ff142

Please sign in to comment.