mirror of https://github.com/grpc/grpc-java.git
core: clarify exception message
Reformulate message to highlight that SizeEnforcingInputStream is applied on the message size of the message after decompression.
This commit is contained in:
parent
ffebe231c0
commit
62fafe7eda
|
|
@ -517,8 +517,8 @@ public class MessageDeframer implements Closeable, Deframer {
|
|||
private void verifySize() {
|
||||
if (count > maxMessageSize) {
|
||||
throw Status.RESOURCE_EXHAUSTED.withDescription(String.format(
|
||||
"Compressed gRPC message exceeds maximum size %d: %d bytes read",
|
||||
maxMessageSize, count)).asRuntimeException();
|
||||
"Decompressed gRPC message exceeds maximum size %d",
|
||||
maxMessageSize)).asRuntimeException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ public class MessageDeframerTest {
|
|||
|
||||
try {
|
||||
thrown.expect(StatusRuntimeException.class);
|
||||
thrown.expectMessage("RESOURCE_EXHAUSTED: Compressed gRPC message exceeds");
|
||||
thrown.expectMessage("RESOURCE_EXHAUSTED: Decompressed gRPC message exceeds");
|
||||
|
||||
while (stream.read() != -1) {
|
||||
}
|
||||
|
|
@ -424,7 +424,7 @@ public class MessageDeframerTest {
|
|||
|
||||
try {
|
||||
thrown.expect(StatusRuntimeException.class);
|
||||
thrown.expectMessage("RESOURCE_EXHAUSTED: Compressed gRPC message exceeds");
|
||||
thrown.expectMessage("RESOURCE_EXHAUSTED: Decompressed gRPC message exceeds");
|
||||
|
||||
stream.read(buf, 0, buf.length);
|
||||
} finally {
|
||||
|
|
@ -467,7 +467,7 @@ public class MessageDeframerTest {
|
|||
|
||||
try {
|
||||
thrown.expect(StatusRuntimeException.class);
|
||||
thrown.expectMessage("RESOURCE_EXHAUSTED: Compressed gRPC message exceeds");
|
||||
thrown.expectMessage("RESOURCE_EXHAUSTED: Decompressed gRPC message exceeds");
|
||||
|
||||
stream.skip(4);
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Reference in New Issue