Skip to content

Commit 3766578

Browse files
committed
Minor change to ensure that only IOExceptions passed through but JsonGenerationException wrapped as JsonMappingException
1 parent 4fa081e commit 3766578

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/fasterxml/jackson/databind/ser/std/StdSerializer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public void wrapAndThrow(SerializerProvider provider,
306306
// Ditto for IOExceptions... except for mapping exceptions!
307307
boolean wrap = (provider == null) || provider.isEnabled(SerializationFeature.WRAP_EXCEPTIONS);
308308
if (t instanceof IOException) {
309-
if (!wrap || !(t instanceof JsonMappingException)) {
309+
if (!wrap || !(t instanceof JacksonException)) {
310310
throw (IOException) t;
311311
}
312312
} else if (!wrap) {
@@ -328,7 +328,7 @@ public void wrapAndThrow(SerializerProvider provider,
328328
// Ditto for IOExceptions... except for mapping exceptions!
329329
boolean wrap = (provider == null) || provider.isEnabled(SerializationFeature.WRAP_EXCEPTIONS);
330330
if (t instanceof IOException) {
331-
if (!wrap || !(t instanceof JsonMappingException)) {
331+
if (!wrap || !(t instanceof JacksonException)) {
332332
throw (IOException) t;
333333
}
334334
} else if (!wrap) {

0 commit comments

Comments
 (0)