From e59184ffac6005b69d4f71155cc43ec3df2a0fd9 Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Tue, 22 Apr 2008 12:54:40 +0000 Subject: enhance some exception messages git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@338 f203690c-595d-4dc9-a70b-905162fa7fd2 --- src/java/com/healthmarketscience/jackcess/Column.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/java/com/healthmarketscience/jackcess/Column.java b/src/java/com/healthmarketscience/jackcess/Column.java index bf14d12..dde0985 100644 --- a/src/java/com/healthmarketscience/jackcess/Column.java +++ b/src/java/com/healthmarketscience/jackcess/Column.java @@ -608,8 +608,9 @@ public class Column implements Comparable { // check precision if(decVal.precision() > getPrecision()) { - throw new IOException("Numeric value is too big for specified precision " - + getPrecision() + ": " + decVal); + throw new IOException( + "Numeric value is too big for specified precision " + + getPrecision() + ": " + decVal); } // convert to unscaled BigInteger, big-endian bytes @@ -741,7 +742,9 @@ public class Column implements Comparable { int remainingRowLength) throws IOException { if(value.length > getType().getMaxSize()) { - throw new IOException("value too big for column"); + throw new IOException("value too big for column, max " + + getType().getMaxSize() + ", got " + + value.length); } // determine which type to write @@ -905,7 +908,8 @@ public class Column implements Comparable { CharSequence text = toCharSequence(obj); int maxChars = getLengthInUnits(); if (text.length() > maxChars) { - throw new IOException("Text is too big for column"); + throw new IOException("Text is too big for column, max " + maxChars + + ", got " + text.length()); } byte[] encodedData = encodeUncompressedText(text, getFormat()).array(); obj = encodedData; -- cgit v1.2.3