kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: MINOR: Include more detail in `ConfigDef.parseType` exception message
Date Fri, 27 Jan 2017 12:29:21 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.10.2 fcdfe8e98 -> 02a516f12


MINOR: Include more detail in `ConfigDef.parseType` exception message

Author: Kamal C <kamal.chandraprakash@gmail.com>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>, Ismael Juma <ismael@juma.me.uk>

Closes #2345 from Kamal15/trunk

(cherry picked from commit ec76ea343616df27ae2a4e42f5078e081d5878e2)
Signed-off-by: Ismael Juma <ismael@juma.me.uk>


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/02a516f1
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/02a516f1
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/02a516f1

Branch: refs/heads/0.10.2
Commit: 02a516f125c2320eca8e98f7a587ad4b9f1f3c2a
Parents: fcdfe8e
Author: Kamal C <kamal.chandraprakash@gmail.com>
Authored: Fri Jan 27 12:09:14 2017 +0000
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Fri Jan 27 12:24:19 2017 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/kafka/common/config/ConfigDef.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/02a516f1/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java b/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
index 89feb9a..5257f6e 100644
--- a/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
+++ b/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
@@ -638,7 +638,7 @@ public class ConfigDef {
                     } else if (value instanceof String) {
                         return Integer.parseInt(trimmed);
                     } else {
-                        throw new ConfigException(name, value, "Expected value to be an number.");
+                        throw new ConfigException(name, value, "Expected value to be a 32-bit
integer, but it was a " + value.getClass().getName());
                     }
                 case SHORT:
                     if (value instanceof Short) {
@@ -646,7 +646,7 @@ public class ConfigDef {
                     } else if (value instanceof String) {
                         return Short.parseShort(trimmed);
                     } else {
-                        throw new ConfigException(name, value, "Expected value to be an number.");
+                        throw new ConfigException(name, value, "Expected value to be a 16-bit
integer (short), but it was a " + value.getClass().getName());
                     }
                 case LONG:
                     if (value instanceof Integer)
@@ -656,14 +656,14 @@ public class ConfigDef {
                     else if (value instanceof String)
                         return Long.parseLong(trimmed);
                     else
-                        throw new ConfigException(name, value, "Expected value to be an number.");
+                        throw new ConfigException(name, value, "Expected value to be a 64-bit
integer (long), but it was a " + value.getClass().getName());
                 case DOUBLE:
                     if (value instanceof Number)
                         return ((Number) value).doubleValue();
                     else if (value instanceof String)
                         return Double.parseDouble(trimmed);
                     else
-                        throw new ConfigException(name, value, "Expected value to be an number.");
+                        throw new ConfigException(name, value, "Expected value to be a double,
but it was a " + value.getClass().getName());
                 case LIST:
                     if (value instanceof List)
                         return (List<?>) value;


Mime
View raw message