package com.palantir.atlasdb.keyvalue.partition.exception;

import com.google.common.base.Preconditions;
import com.palantir.atlasdb.keyvalue.partition.PartitionedKeyValueService;
import com.palantir.atlasdb.keyvalue.partition.api.DynamicPartitionMap;
import com.palantir.atlasdb.keyvalue.remoting.RemotingPartitionMapService;
import com.palantir.atlasdb.keyvalue.remoting.proxy.FillInUrlProxy;
import com.palantir.common.annotation.Immutable;

/**
 * This exception is thrown by the remote service when the client
 * partition map version is older than server's.
 *
 * It is then serialized over HTTP and is meant to be intercepted
 * by the local KeyValueEndpoint instance. That class should throw
 * a new instance of this class with the pmsUri filled in.
 *
 * The <code>PartitionedKeyValueService</code> can than catch it and
 * download new partition map using the provided URI.
 *
 * @see FillInUrlProxy
 * @see PartitionedKeyValueService
 *
 * @author htarasiuk
 *
 */
@Immutable public class VersionTooOldException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private final String pmsUri;

    /**
     * Only use this if the pmsUri has been filled in.
     *
     * @return An updated version of the partion map; downloaded from the PartitionMapService
     * associated with the KeyValueService that threw the original exception.
     */
    public DynamicPartitionMap getUpdatedMap() {
    	return RemotingPartitionMapService.createClientSide(
    			Preconditions.checkNotNull(pmsUri)).get();
    }

    public VersionTooOldException(String pmsUri) {
        // WARNING! The message has to be filled in with pmsUri since some
        // Palantir Throwables rewrapping logic will recreate the exception by
        // passing the getMessage() result to the single-argument constructor.
        super(pmsUri);
    	this.pmsUri = Preconditions.checkNotNull(pmsUri);
    }

    public VersionTooOldException() {
        super();
    	this.pmsUri = null;
    }

	@Override
	public String toString() {
		return "VersionTooOldException [pmsUri=" + pmsUri + "]";
	}
}

@@ -388,16 +388,97 @@
 lProxy;%0A
+import com.palantir.atlasdb.transaction.api.TransactionFailedRetriableException;%0A
 import c
@@ -1110,14 +1110,33 @@
 nds 
-Runtim
+TransactionFailedRetriabl
 eExc
@@ -2068,16 +2068,20 @@
   super(
+null
 );%0A    %09

Make VersionTooOldException extend TransactionFailedRetriableException.