/** * Trace an error with current writer state and returns a corresponding exception. * * @param value current value * @param message error message * @param writer current writer * * @return a {@link JsonSerializationException} with the given message */ public JsonSerializationException traceError( Object value, String message, JsonWriter writer ) { JsonSerializationException exception = traceError( value, message ); traceWriterInfo( value, writer ); return exception; }
/** * Trace an error with current writer state and returns a corresponding exception. * * @param value current value * @param cause cause of the error * @param writer current writer * * @return a {@link JsonSerializationException} if we wrap the exceptions, the cause otherwise */ public RuntimeException traceError( Object value, RuntimeException cause, JsonWriter writer ) { RuntimeException exception = traceError( value, cause ); traceWriterInfo( value, writer ); return exception; }