Skip to content

Commit 5a25cd9

Browse files
committed
fix(microservices): report correct buffer length in exception
1 parent d559b81 commit 5a25cd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/microservices/helpers/json-socket.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ export class JsonSocket extends TcpSocket {
2424
this.buffer += data;
2525

2626
if (this.buffer.length > MAX_BUFFER_SIZE) {
27+
const bufferLength = this.buffer.length;
2728
this.buffer = '';
28-
throw new MaxPacketLengthExceededException(this.buffer.length);
29+
throw new MaxPacketLengthExceededException(bufferLength);
2930
}
3031

3132
if (this.contentLength === null) {

0 commit comments

Comments
 (0)