]> source.dussan.org Git - jackcess.git/commitdiff
enhance some exception messages
authorJames Ahlborn <jtahlborn@yahoo.com>
Tue, 22 Apr 2008 12:54:40 +0000 (12:54 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Tue, 22 Apr 2008 12:54:40 +0000 (12:54 +0000)
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

index bf14d12d1dd07a8999da5131b12f17fc9ea79fc2..dde098538000896f9ab0dda4851d4a66f9d60f4f 100644 (file)
@@ -608,8 +608,9 @@ public class Column implements Comparable<Column> {
 
       // 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<Column> {
                                    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<Column> {
         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;