You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by yu...@apache.org on 2022/05/19 12:42:12 UTC
[pulsar] branch master updated: [improve][tools] Modify IllegalException to ParameterException in CmdFunctions (#15658)
This is an automated email from the ASF dual-hosted git repository.
yuruguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new e97d8467bea [improve][tools] Modify IllegalException to ParameterException in CmdFunctions (#15658)
e97d8467bea is described below
commit e97d8467beabb93f2707b6d90385b5285c6a0d02
Author: hf688 <10...@users.noreply.github.com>
AuthorDate: Thu May 19 20:42:06 2022 +0800
[improve][tools] Modify IllegalException to ParameterException in CmdFunctions (#15658)
---
.../src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
index ad036f6f25f..203aea96f2c 100644
--- a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
+++ b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
@@ -646,7 +646,7 @@ public class CmdFunctions extends CmdBase {
if (functionConfig.getRuntime() == FunctionConfig.Runtime.PYTHON
|| functionConfig.getRuntime() == FunctionConfig.Runtime.JAVA){
if (StringUtils.isEmpty(functionConfig.getClassName())) {
- throw new IllegalArgumentException("No Function Classname specified");
+ throw new ParameterException("No Function Classname specified");
}
}
if (StringUtils.isEmpty(functionConfig.getName())) {
@@ -960,7 +960,7 @@ public class CmdFunctions extends CmdBase {
protected void validateFunctionConfigs(FunctionConfig functionConfig) {
if (StringUtils.isEmpty(functionConfig.getClassName())) {
if (StringUtils.isEmpty(functionConfig.getName())) {
- throw new IllegalArgumentException("Function Name not provided");
+ throw new ParameterException("Function Name not provided");
}
} else if (StringUtils.isEmpty(functionConfig.getName())) {
org.apache.pulsar.common.functions.Utils.inferMissingFunctionName(functionConfig);