Skip to content

Commit 30a3b6a

Browse files
committed
Merge pull request #949 from swankjesse/jwilson_0926_exceptions
Report the offending substring when number parsing fails
2 parents 90da5db + 4161387 commit 30a3b6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/fasterxml/jackson/databind/util/ISO8601Utils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,14 @@ private static int parseInt(String value, int beginIndex, int endIndex) throws N
311311
if (i < endIndex) {
312312
digit = Character.digit(value.charAt(i++), 10);
313313
if (digit < 0) {
314-
throw new NumberFormatException("Invalid number: " + value);
314+
throw new NumberFormatException("Invalid number: " + value.substring(beginIndex, endIndex));
315315
}
316316
result = -digit;
317317
}
318318
while (i < endIndex) {
319319
digit = Character.digit(value.charAt(i++), 10);
320320
if (digit < 0) {
321-
throw new NumberFormatException("Invalid number: " + value);
321+
throw new NumberFormatException("Invalid number: " + value.substring(beginIndex, endIndex));
322322
}
323323
result *= 10;
324324
result -= digit;

0 commit comments

Comments
 (0)