Make exception messages more specific
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/fileupload/trunk@1458467 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java b/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
index de61cc7..3d5231a 100644
--- a/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
+++ b/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
@@ -84,7 +84,7 @@
// we found an encoded character. Reduce the 3 char sequence to one.
// but first, make sure we have two characters to work with.
if (off + 1 >= endOffset) {
- throw new IOException("Invalid quoted printable encoding");
+ throw new IOException("Invalid quoted printable encoding; truncated escape sequence");
}
// convert the two bytes back from hex.
byte b1 = data[off++];
@@ -93,7 +93,7 @@
// we've found an encoded carriage return. The next char needs to be a newline
if (b1 == '\r') {
if (b2 != '\n') {
- throw new IOException("Invalid quoted printable encoding");
+ throw new IOException("Invalid quoted printable encoding; CR must be followed by LF");
}
// this was a soft linebreak inserted by the encoding. We just toss this away
// on decode.