@@ -217,35 +217,39 @@ public Collection<String> deserialize(JsonParser p, DeserializationContext ctxt,
217
217
private Collection <String > deserializeUsingCustom (JsonParser p , DeserializationContext ctxt ,
218
218
Collection <String > result , final JsonDeserializer <String > deser ) throws IOException
219
219
{
220
- while (true ) {
221
- /* 30-Dec-2014, tatu: This may look odd, but let's actually call method
222
- * that suggest we are expecting a String; this helps with some formats,
223
- * notably XML. Note, however, that while we can get String, we can't
224
- * assume that's what we use due to custom deserializer
225
- */
226
- String value ;
227
- if (p .nextTextValue () == null ) {
228
- JsonToken t = p .getCurrentToken ();
229
- if (t == JsonToken .END_ARRAY ) {
230
- break ;
231
- }
232
- // Ok: no need to convert Strings, but must recognize nulls
233
- if (t == JsonToken .VALUE_NULL ) {
234
- if (_skipNullValues ) {
235
- continue ;
220
+ try {
221
+ while (true ) {
222
+ /* 30-Dec-2014, tatu: This may look odd, but let's actually call method
223
+ * that suggest we are expecting a String; this helps with some formats,
224
+ * notably XML. Note, however, that while we can get String, we can't
225
+ * assume that's what we use due to custom deserializer
226
+ */
227
+ String value ;
228
+ if (p .nextTextValue () == null ) {
229
+ JsonToken t = p .getCurrentToken ();
230
+ if (t == JsonToken .END_ARRAY ) {
231
+ break ;
232
+ }
233
+ // Ok: no need to convert Strings, but must recognize nulls
234
+ if (t == JsonToken .VALUE_NULL ) {
235
+ if (_skipNullValues ) {
236
+ continue ;
237
+ }
238
+ value = (String ) _nullProvider .getNullValue (ctxt );
239
+ } else {
240
+ value = deser .deserialize (p , ctxt );
236
241
}
237
- value = (String ) _nullProvider .getNullValue (ctxt );
238
242
} else {
239
243
value = deser .deserialize (p , ctxt );
240
244
}
241
- } else {
242
- value = deser .deserialize (p , ctxt );
245
+ result .add (value );
243
246
}
244
- result .add (value );
247
+ } catch (Exception e ) {
248
+ throw JsonMappingException .wrapWithPath (e , result , result .size ());
245
249
}
246
250
return result ;
247
251
}
248
-
252
+
249
253
@ Override
250
254
public Object deserializeWithType (JsonParser p , DeserializationContext ctxt ,
251
255
TypeDeserializer typeDeserializer ) throws IOException {
@@ -282,7 +286,11 @@ private final Collection<String> handleNonArray(JsonParser p, DeserializationCon
282
286
}
283
287
value = (String ) _nullProvider .getNullValue (ctxt );
284
288
} else {
285
- value = (valueDes == null ) ? _parseString (p , ctxt ) : valueDes .deserialize (p , ctxt );
289
+ try {
290
+ value = (valueDes == null ) ? _parseString (p , ctxt ) : valueDes .deserialize (p , ctxt );
291
+ } catch (Exception e ) {
292
+ throw JsonMappingException .wrapWithPath (e , result , result .size ());
293
+ }
286
294
}
287
295
result .add (value );
288
296
return result ;
0 commit comments