From 8fa5b79cf6687e5c8bbe5d8565893f0e553df040 Mon Sep 17 00:00:00 2001 From: walkor Date: Wed, 3 Jan 2024 15:15:37 +0800 Subject: [PATCH] Show bad package stack --- src/Connection/TcpConnection.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Connection/TcpConnection.php b/src/Connection/TcpConnection.php index 96a7a023b..35654099f 100644 --- a/src/Connection/TcpConnection.php +++ b/src/Connection/TcpConnection.php @@ -16,6 +16,7 @@ namespace Workerman\Connection; use JsonSerializable; +use RuntimeException; use stdClass; use Throwable; use Workerman\Events\EventInterface; @@ -684,7 +685,7 @@ public function baseRead($socket, bool $checkEof = true): void } } // Wrong package. else { - Worker::safeEcho('Error package. package_length=' . var_export($this->currentPackageLength, true)); + Worker::safeEcho((string)(new RuntimeException("Protocol $this->protocol Error package. package_length=" . var_export($this->currentPackageLength, true)))); $this->destroy(); return; }