throw new IncompatibleRemoteServiceException(
"Client does not have a type sent by the server", e);
}
CommandServerSerializationStreamReader reader = new CommandServerSerializationStreamReader();
if (decoder.getThrownValue() != null) {
reader.prepareToRead(Collections.singletonList(decoder.getThrownValue()));
try {
throw new RemoteException((Throwable) reader.readObject());
} catch (ClassCastException e) {
throw new RemoteException(
"The remote end threw something other than a Throwable", e);