yuruguo opened a new pull request #12483:
URL: https://github.com/apache/pulsar/pull/12483
### Motivation
We should check the validity of the `--compatibility` and give a more
friendly prompt message when set schema compatibility strategy for namespace
through `./bin/pulsar-admin namespaces set-schema-compatibility-strategy`.
Currently, the lack of verification for `--compatibility` will directly
display the exception, as below:
```
./bin/pulsar-admin namespaces set-schema-compatibility-strategy -c
ALWAYS_COMPATIBE tenant1/ns1
java.lang.IllegalArgumentException: No enum constant
org.apache.pulsar.common.policies.data.SchemaCompatibilityStrategy.ALWAYS_COMPATIBE
at java.lang.Enum.valueOf(Enum.java:238)
at
org.apache.pulsar.common.policies.data.SchemaCompatibilityStrategy.valueOf(SchemaCompatibilityStrategy.java:24)
at
org.apache.pulsar.admin.cli.CmdNamespaces$SetSchemaCompatibilityStrategy.run(CmdNamespaces.java:1833)
at org.apache.pulsar.admin.cli.CmdBase.run(CmdBase.java:86)
at
org.apache.pulsar.admin.cli.PulsarAdminTool.run(PulsarAdminTool.java:282)
at
org.apache.pulsar.admin.cli.PulsarAdminTool.main(PulsarAdminTool.java:329)
```
### Modifications
- Throw `ParameterException` when `IllegalArgumentException` occurs when
executing `SchemaCompatibilityStrategy.valueOf()`
### Documentation
Automatically generate doc through code
- [x] `doc`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]