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();
|
Thread.interrupted();
|
||||||
throw new RuntimeException(ie);
|
throw new RuntimeException(ie);
|
||||||
}
|
}
|
||||||
if (last instanceof Throwable) {
|
if (last instanceof Status) {
|
||||||
throw Throwables.propagate((Throwable) last);
|
throw ((Status) last).asRuntimeException();
|
||||||
}
|
}
|
||||||
return last != this;
|
return last != this;
|
||||||
}
|
}
|
||||||
|
|
@ -415,7 +415,7 @@ public class ClientCalls {
|
||||||
if (status.isOk()) {
|
if (status.isOk()) {
|
||||||
buffer.add(BlockingResponseStream.this);
|
buffer.add(BlockingResponseStream.this);
|
||||||
} else {
|
} else {
|
||||||
buffer.add(status.asRuntimeException());
|
buffer.add(status);
|
||||||
}
|
}
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue