summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2008-04-22 12:54:40 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2008-04-22 12:54:40 +0000
commite59184ffac6005b69d4f71155cc43ec3df2a0fd9 (patch)
treeb683739d46d04dc3af3719807c193f61c7cf7f51
parentb530c3d58ab07bc7fba01680bd9ce7143fd840b3 (diff)
downloadjackcess-e59184ffac6005b69d4f71155cc43ec3df2a0fd9.tar.gz
jackcess-e59184ffac6005b69d4f71155cc43ec3df2a0fd9.zip
enhance some exception messages
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@338 f203690c-595d-4dc9-a70b-905162fa7fd2
-rw-r--r--src/java/com/healthmarketscience/jackcess/Column.java12
1 files 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<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;