Skip to content

Commit 037f8b0

Browse files
committed
improve error handling
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
1 parent 83112d2 commit 037f8b0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pkg/util/flagext/secretstringslicecsv.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package flagext
22

33
import (
4-
"fmt"
4+
"errors"
55
"strings"
66
)
77

@@ -30,7 +30,9 @@ func (v *SecretStringSliceCSV) Set(s string) error {
3030
for _, p := range parts {
3131
p = strings.TrimSpace(p)
3232
if p == "" {
33-
return fmt.Errorf("invalid key list %q: empty entry after trimming", s)
33+
// Do not include the original input value in the error message
34+
// to avoid accidentally exposing secret values.
35+
return errors.New("invalid value: empty entry after trimming")
3436
}
3537
values = append(values, p)
3638
}

0 commit comments

Comments
 (0)