config: Add the default case when failing to parse the log rotate config json
Make sure that the `setupLogRotation` function must return the error when failing parse json.
@@ -272,6 +272,8 @@ func setupLogRotation(logOutputs []string, logRotateConfigJSON string) error {
return fmt.Errorf("improperly formatted log rotation config: %v", err)
case errors.As(err, &unmarshalTypeError):
return fmt.Errorf("invalid log rotation config: %v", err)
+ default:
+ return fmt.Errorf("fail to unmarshal log rotation config: %v", err)
}
}
zap.RegisterSink("rotate", func(u *url.URL) (zap.Sink, error) {
