Improve Exception backtrace for blocked streaming

Delaying creating the exception produces a much more useful exception.
The status code, description, and exception type are all identical. The
only difference in the backtrace.
This commit is contained in:
Eric Anderson 2015-07-01 16:32:04 -07:00
parent 7233077cdf
commit 74b5d29c8a
1 changed files with 3 additions and 3 deletions

View File

@ -370,8 +370,8 @@ public class ClientCalls {
Thread.interrupted();
throw new RuntimeException(ie);
}
if (last instanceof Throwable) {
throw Throwables.propagate((Throwable) last);
if (last instanceof Status) {
throw ((Status) last).asRuntimeException();
}
return last != this;
}
@ -415,7 +415,7 @@ public class ClientCalls {
if (status.isOk()) {
buffer.add(BlockingResponseStream.this);
} else {
buffer.add(status.asRuntimeException());
buffer.add(status);
}
done = true;
}