Skip to content

Commit 695754b

Browse files
committed
Now that we are on Java 1.4, we can save the original exception when we rethrow another exception.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@797673 13f79535-47bb-0310-9956-ffa450edef68
1 parent 9137228 commit 695754b

5 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/java/org/apache/commons/codec/binary/Hex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public Object decode(Object object) throws DecoderException {
187187
char[] charArray = object instanceof String ? ((String) object).toCharArray() : (char[]) object;
188188
return decodeHex(charArray);
189189
} catch (ClassCastException e) {
190-
throw new DecoderException(e.getMessage());
190+
throw new DecoderException(e.getMessage(), e);
191191
}
192192
}
193193

src/java/org/apache/commons/codec/net/BCodec.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,10 @@ public String encode(String value) throws EncoderException {
134134
* representation.
135135
*
136136
* @param value
137-
* Base64 string to convert into its original form
138-
*
137+
* Base64 string to convert into its original form
139138
* @return original string
140-
*
141139
* @throws DecoderException
142-
* A decoder exception is thrown if a failure condition is encountered during the decode process.
140+
* A decoder exception is thrown if a failure condition is encountered during the decode process.
143141
*/
144142
public String decode(String value) throws DecoderException {
145143
if (value == null) {
@@ -148,7 +146,7 @@ public String decode(String value) throws DecoderException {
148146
try {
149147
return decodeText(value);
150148
} catch (UnsupportedEncodingException e) {
151-
throw new DecoderException(e.getMessage());
149+
throw new DecoderException(e.getMessage(), e);
152150
}
153151
}
154152

src/java/org/apache/commons/codec/net/QCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public String decode(String pString) throws DecoderException {
230230
try {
231231
return decodeText(pString);
232232
} catch (UnsupportedEncodingException e) {
233-
throw new DecoderException(e.getMessage());
233+
throw new DecoderException(e.getMessage(), e);
234234
}
235235
}
236236

src/java/org/apache/commons/codec/net/QuotedPrintableCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public String decode(String pString) throws DecoderException {
302302
try {
303303
return decode(pString, getDefaultCharset());
304304
} catch (UnsupportedEncodingException e) {
305-
throw new DecoderException(e.getMessage());
305+
throw new DecoderException(e.getMessage(), e);
306306
}
307307
}
308308

src/java/org/apache/commons/codec/net/URLCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public String decode(String pString) throws DecoderException {
296296
try {
297297
return decode(pString, getDefaultCharset());
298298
} catch (UnsupportedEncodingException e) {
299-
throw new DecoderException(e.getMessage());
299+
throw new DecoderException(e.getMessage(), e);
300300
}
301301
}
302302

0 commit comments

Comments
 (0)