彩票计划微信群

TP6 workerman运行时使用json输出错误会产生异常

浏览:69 发布日期:2019/11/07
5.0.0 - 致命 - 未处理
tp6版本 使用workerman运行
我重写了错误错误,将错误输出为json    public function render($request, Throwable $e): Response
    {
        // 添加自定义异常处理机制

        // 其他错误交给系统处理
//        return parent::render($request, $e);
        $this->isJson = true;
        if ($e instanceof HttpResponseException) {
            return $e->getResponse();
        } elseif ($e instanceof HttpException) {
            return $this->renderHttpException($e);
        } else {
            return $this->convertExceptionToResponse($e);
        }
    }
然后运行的命令行就会报错:InvalidArgumentException: Recursion detected in /mnt/d/webProject/electric_energize_php_api/vendor/topthink/framework/src/think/response/Json.php:54
Stack trace:
#0 /mnt/d/webProject/electric_energize_php_api/vendor/topthink/framework/src/think/Response.php(384): think\response\Json->output(false)
#1 /mnt/d/webProject/electric_energize_php_api/vendor/topthink/think-worker/src/Application.php(92): think\Response->getContent()
#2 /mnt/d/webProject/electric_energize_php_api/vendor/topthink/think-worker/src/Application.php(67): think\worker\Application->exception(Object(Workerman\Connection\TcpConnection), Object(InvalidArgumentException))
#3 /mnt/d/webProject/electric_energize_php_api/vendor/topthink/think-worker/src/Http.php(161): think\worker\Application->worker(Object(Workerman\Connection\TcpConnection), Array)
#4 /mnt/d/webProject/electric_energize_php_api/vendor/workerman/workerman/Connection/TcpConnection.php(658): think\worker\Http->onMessage(Object(Workerman\Connection\TcpConnection), Array)
#5 /mnt/d/webProject/electric_energize_php_api/vendor/workerman/workerman/Events/Select.php(294): Workerman\Connection\TcpConnection->baseRead(Resource id #194)
#6 /mnt/d/webProject/electric_energize_php_api/vendor/workerman/workerman/Worker.php(2382): Workerman\Events\Select->loop()
#7 /mnt/d/webProject/electric_energize_php_api/vendor/workerman/workerman/Worker.php(1490): Workerman\Worker->run()
#8 /mnt/d/webProject/electric_energize_php_api/vendor/workerman/workerman/Worker.php(1320): Workerman\Worker::forkOneWorkerForLinux(Object(Workerman\Worker))
#9 /mnt/d/webProject/electric_energize_php_api/vendor/workerman/workerman/Worker.php(1294): Workerman\Worker::forkWorkersForLinux()
#10 /mnt/d/webProject/electric_energize_php_api/vendor/workerman/workerman/Worker.php(509): Workerman\Worker::forkWorkers()
#11 /mnt/d/webProject/electric_energize_php_api/vendor/topthink/think-worker/src/Http.php(278): Workerman\Worker::runAll()
#12 /mnt/d/webProject/electric_energize_php_api/vendor/topthink/think-worker/src/command/Worker.php(135): think\worker\Http->start()
#13 /mnt/d/webProject/electric_energize_php_api/vendor/topthink/framework/src/think/console/Command.php(210): think\worker\command\Worker->execute(Object(think\console\Input), Object(think\console\Output))
#14 /mnt/d/webProject/electric_energize_php_api/vendor/topthink/framework/src/think/Console.php(600): think\console\Command->run(Object(think\console\Input), Object(think\console\Output))
#15 /mnt/d/webProject/electric_energize_php_api/vendor/topthink/framework/src/think/Console.php(259): think\Console->doRunCommand(Object(think\worker\command\Worker), Object(think\console\Input), Object(think\console\Output))
#16 /mnt/d/webProject/electric_energize_php_api/vendor/topthink/framework/src/think/Console.php(196): think\Console->doRun(Object(think\console\Input), Object(think\console\Output))
#17 /mnt/d/webProject/electric_energize_php_api/think(10): think\Console->run()
#18 {main}
Worker[24902] process terminated
worker[thinkphp:24902] exit with status 64000
接着客户端就会收不到任何响应。
评论(
后面还有条评论,点击查看>>
正规彩票微信讨论群 彩票QQ群 微信彩票投注群 微信彩票投注群 幸运飞艇微信红包群 微信彩票注册群 彩票微信红包群二维码大全 pk10高手微信交流群 幸运飞艇微信红包群 彩票高手微信交流群