mirror of https://github.com/grpc/grpc-java.git
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:
parent
7233077cdf
commit
74b5d29c8a
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue