You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2013/03/19 20:31:39 UTC
svn commit: r1458467 -
/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Author: sebb
Date: Tue Mar 19 19:31:38 2013
New Revision: 1458467
URL: http://svn.apache.org/r1458467
Log:
Make exception messages more specific
Modified:
commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1458467&r1=1458466&r2=1458467&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java (original)
+++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java Tue Mar 19 19:31:38 2013
@@ -84,7 +84,7 @@ final class QuotedPrintableDecoder {
// 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 @@ final class QuotedPrintableDecoder {
// 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.