try {
final SerializationFactory serializationFactory = this.getSerializationFactory();
final String stream = response.getText();
final ObjectInputStream objectInputStream = serializationFactory.createObjectInputStream(stream);
final boolean exceptionWasThrown = objectInputStream.readBoolean();
final Object result = objectInputStream.readObject();
if (exceptionWasThrown) {
callback.onFailure((Throwable) result);
break;