Object proc0 = ((JsonProcessingException) src).getProcessor(); if (proc0 instanceof Closeable) { proc = (Closeable) proc0;
@Nullable @Override public Object getProcessor() { Throwable rootCause = getCause(); if (rootCause instanceof JsonProcessingException) { return ((JsonProcessingException) rootCause).getProcessor(); } return null; }
@Nullable @Override public Object getProcessor() { Throwable rootCause = getCause(); if (rootCause instanceof JsonProcessingException) { return ((JsonProcessingException) rootCause).getProcessor(); } return null; }
/** * Method that can be called to either create a new JsonMappingException * (if underlying exception is not a JsonMappingException), or augment * given exception with given path/reference information. */ @SuppressWarnings("resource") public static JsonMappingException wrapWithPath(Throwable src, Reference ref) { JsonMappingException jme; if (src instanceof JsonMappingException) { jme = (JsonMappingException) src; } else { String msg = src.getMessage(); // Let's use a more meaningful placeholder if all we have is null if (msg == null || msg.length() == 0) { msg = "(was "+src.getClass().getName()+")"; } // 17-Aug-2015, tatu: Let's also pass the processor (parser/generator) along Closeable proc = null; if (src instanceof JsonProcessingException) { Object proc0 = ((JsonProcessingException) src).getProcessor(); if (proc0 instanceof Closeable) { proc = (Closeable) proc0; } } jme = new JsonMappingException(proc, msg, src); } jme.prependPath(ref); return jme; }
Object proc0 = ((JsonProcessingException) src).getProcessor(); if (proc0 instanceof Closeable) { proc = (Closeable) proc0;