/** * Trace an error with current reader state and returns a corresponding exception. * * @param cause cause of the error * @param reader current reader * * @return a {@link JsonDeserializationException} if we wrap the exceptions, the cause otherwise */ public RuntimeException traceError( RuntimeException cause, JsonReader reader ) { RuntimeException exception = traceError( cause ); traceReaderInfo( reader ); return exception; }
/** * Trace an error with current reader state and returns a corresponding exception. * * @param message error message * @param reader current reader * * @return a {@link JsonDeserializationException} with the given message */ public JsonDeserializationException traceError( String message, JsonReader reader ) { getLogger().log( Level.SEVERE, message ); traceReaderInfo( reader ); return new JsonDeserializationException( message ); }