Add state in exception message (#10842)
Motivation: We should add `state` in the exception message of `HttpObjectEncoder` because it makes debugging a little easier. Modification: Added `state` in the exception message. Result: Better exception message for smooth debugging.
This commit is contained in:
parent
f551db2bda
commit
abd5a7d922
@ -121,7 +121,8 @@ public abstract class HttpObjectEncoder<H extends HttpMessage> extends MessageTo
|
|||||||
if (msg instanceof HttpContent || msg instanceof ByteBuf || msg instanceof FileRegion) {
|
if (msg instanceof HttpContent || msg instanceof ByteBuf || msg instanceof FileRegion) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case ST_INIT:
|
case ST_INIT:
|
||||||
throw new IllegalStateException("unexpected message type: " + StringUtil.simpleClassName(msg));
|
throw new IllegalStateException("unexpected message type: " + StringUtil.simpleClassName(msg)
|
||||||
|
+ ", state: " + state);
|
||||||
case ST_CONTENT_NON_CHUNK:
|
case ST_CONTENT_NON_CHUNK:
|
||||||
final long contentLength = contentLength(msg);
|
final long contentLength = contentLength(msg);
|
||||||
if (contentLength > 0) {
|
if (contentLength > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user