yuanzhihai / easyhttp

轻量级、语义化、对IDE友好的HTTP客户端
MIT License
36 stars 3 forks source link

偶尔报错,不知道哪的问题 #2

Open pengdefang opened 1 year ago

pengdefang commented 1 year ago

31 {main}Error: Call to a member function getHeaders() on null in /app/webman/vendor/yzh52521/easyhttp/src/Request.php:3

Stack trace:

0 [internal function]: yzh52521\EasyHttp\Request->yzh52521\EasyHttp{closure}()

1 /app/webman/vendor/yzh52521/easyhttp/src/Logger.php(178): call_user_func()

2 /app/webman/vendor/yzh52521/easyhttp/src/Logger.php(141): yzh52521\EasyHttp\Logger->getLogMessage()

3 /app/webman/vendor/yzh52521/easyhttp/src/Logger.php(244): yzh52521\EasyHttp\Logger->log()

4 /app/webman/vendor/guzzlehttp/promises/src/RejectedPromise.php(42): yzh52521\EasyHttp\Logger->yzh52521\EasyHttp{closu

5 /app/webman/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\RejectedPromise::GuzzleHttp\Promise{

6 /app/webman/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Promise\TaskQueue->run()

7 /app/webman/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()

8 /app/webman/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()

9 /app/webman/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()

10 /app/webman/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()

11 /app/webman/vendor/guzzlehttp/guzzle/src/Client.php(187): GuzzleHttp\Promise\Promise->wait()

12 /app/webman/vendor/yzh52521/easyhttp/src/Request.php(497): GuzzleHttp\Client->request()

13 /app/webman/vendor/yzh52521/easyhttp/src/Request.php(364): yzh52521\EasyHttp\Request->request()

yuanzhihai commented 1 year ago

升级最新版 试试

pengdefang commented 1 year ago

升级最新版 试试

试了最新版本,一样的出现,这个错误要不然try catch怎么捕获?