diff options
author | Arne Juul <arnej@vespa.ai> | 2023-12-14 08:27:15 +0000 |
---|---|---|
committer | Arne Juul <arnej@vespa.ai> | 2023-12-14 08:55:52 +0000 |
commit | 704b0bfd1cf183edee8f013d1ea67726393ebcc5 (patch) | |
tree | 5d14c107b48242385ad7345c428ae5f6eb38436f /config-model/src | |
parent | 990aab34103e545f17f3e05b02a6b2f7bcdca05c (diff) |
fallback to parseDouble
Diffstat (limited to 'config-model/src')
2 files changed, 2 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidator.java index 9f1c072ad8b..40c9a03b126 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidator.java @@ -293,7 +293,7 @@ public class ConstantTensorJsonValidator { double d = decodeNumberString(input); return; } catch (NumberFormatException e) { - throw new InvalidConstantTensorException(parser, String.format("Inside '%s': %s", where, e.getMessage())); + throw new InvalidConstantTensorException(parser, String.format("Inside '%s': cell value '%s' is not a number", where, input)); } } throw new InvalidConstantTensorException(parser, String.format("Inside '%s': cell value is not a number (%s)", where, token.toString())); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidatorTest.java index 9171aae170c..e23697c53da 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidatorTest.java @@ -208,7 +208,7 @@ public class ConstantTensorJsonValidatorTest { " ]", "}")); }); - assertTrue(exception.getMessage().contains("Inside 'value': Excepted a number, got string 'fruit'")); + assertTrue(exception.getMessage().contains("Inside 'value': cell value 'fruit' is not a number")); } @Test |