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() {
|
private void verifySize() {
|
||||||
if (count > maxMessageSize) {
|
if (count > maxMessageSize) {
|
||||||
throw Status.RESOURCE_EXHAUSTED.withDescription(String.format(
|
throw Status.RESOURCE_EXHAUSTED.withDescription(String.format(
|
||||||
"Compressed gRPC message exceeds maximum size %d: %d bytes read",
|
"Decompressed gRPC message exceeds maximum size %d",
|
||||||
maxMessageSize, count)).asRuntimeException();
|
maxMessageSize)).asRuntimeException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,7 @@ public class MessageDeframerTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
thrown.expect(StatusRuntimeException.class);
|
thrown.expect(StatusRuntimeException.class);
|
||||||
thrown.expectMessage("RESOURCE_EXHAUSTED: Compressed gRPC message exceeds");
|
thrown.expectMessage("RESOURCE_EXHAUSTED: Decompressed gRPC message exceeds");
|
||||||
|
|
||||||
while (stream.read() != -1) {
|
while (stream.read() != -1) {
|
||||||
}
|
}
|
||||||
|
|
@ -424,7 +424,7 @@ public class MessageDeframerTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
thrown.expect(StatusRuntimeException.class);
|
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);
|
stream.read(buf, 0, buf.length);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -467,7 +467,7 @@ public class MessageDeframerTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
thrown.expect(StatusRuntimeException.class);
|
thrown.expect(StatusRuntimeException.class);
|
||||||
thrown.expectMessage("RESOURCE_EXHAUSTED: Compressed gRPC message exceeds");
|
thrown.expectMessage("RESOURCE_EXHAUSTED: Decompressed gRPC message exceeds");
|
||||||
|
|
||||||
stream.skip(4);
|
stream.skip(4);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue