Skip to content

Commit

Permalink
err check
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathi-tenneti committed Apr 29, 2020
1 parent 3644686 commit bc38731
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/log/zap/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ func (ev *timeEncoderFlag) Set(flagValue string) error {
val := strings.ToLower(flagValue)
switch val {
case "iso8601", "rfc3339", "rfc3339nano", "millis", "nanos", "epoch":
encoder.UnmarshalText([]byte(val))
if err := encoder.UnmarshalText([]byte(val)); err != nil {
return fmt.Errorf("unable to unmarshal, \"%s\"", val)
}
default:
return fmt.Errorf("invalid value for time encoder, \"%s\"", val)
}
Expand Down

0 comments on commit bc38731

Please sign in to comment.