Skip to content

Commit bc38731

Browse files
err check
1 parent 3644686 commit bc38731

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/log/zap/flags.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ func (ev *timeEncoderFlag) Set(flagValue string) error {
110110
val := strings.ToLower(flagValue)
111111
switch val {
112112
case "iso8601", "rfc3339", "rfc3339nano", "millis", "nanos", "epoch":
113-
encoder.UnmarshalText([]byte(val))
113+
if err := encoder.UnmarshalText([]byte(val)); err != nil {
114+
return fmt.Errorf("unable to unmarshal, \"%s\"", val)
115+
}
114116
default:
115117
return fmt.Errorf("invalid value for time encoder, \"%s\"", val)
116118
}

0 commit comments

Comments
 (0)