diff --git a/server/src/main/java/io/druid/client/DirectDruidClient.java b/server/src/main/java/io/druid/client/DirectDruidClient.java index 6c376ed479e..fa95ba97f11 100644 --- a/server/src/main/java/io/druid/client/DirectDruidClient.java +++ b/server/src/main/java/io/druid/client/DirectDruidClient.java @@ -34,6 +34,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.metamx.common.IAE; import com.metamx.common.Pair; +import com.metamx.common.RE; import com.metamx.common.guava.BaseSequence; import com.metamx.common.guava.Sequence; import com.metamx.common.guava.Sequences; @@ -203,7 +204,7 @@ public class DirectDruidClient implements QueryRunner @Override public JsonParserIterator make() { - return new JsonParserIterator(typeRef, future); + return new JsonParserIterator(typeRef, future, url); } @Override @@ -239,11 +240,13 @@ public class DirectDruidClient implements QueryRunner private ObjectCodec objectCodec; private final JavaType typeRef; private final Future future; + private final String url; - public JsonParserIterator(JavaType typeRef, Future future) + public JsonParserIterator(JavaType typeRef, Future future, String url) { this.typeRef = typeRef; this.future = future; + this.url = url; jp = null; } @@ -289,20 +292,20 @@ public class DirectDruidClient implements QueryRunner try { jp = objectMapper.getFactory().createParser(future.get()); if (jp.nextToken() != JsonToken.START_ARRAY) { - throw new IAE("Next token wasn't a START_ARRAY, was[%s]", jp.getCurrentToken()); + throw new IAE("Next token wasn't a START_ARRAY, was[%s] from url [%s]", jp.getCurrentToken(), url); } else { jp.nextToken(); objectCodec = jp.getCodec(); } } catch (IOException e) { - throw Throwables.propagate(e); + throw new RE(e, "Failure getting results from[%s]", url); } catch (InterruptedException e) { - throw Throwables.propagate(e); + throw new RE(e, "Failure getting results from[%s]", url); } catch (ExecutionException e) { - throw Throwables.propagate(e); + throw new RE(e, "Failure getting results from[%s]", url); } } }