This commit is contained in:
2021-10-09 15:41:38 +08:00
parent 884c851e8a
commit f276e0c6d3
+3 -1
View File
@@ -13,6 +13,8 @@ use Exception;
use Http\Message\Response;
use Http\Message\Stream;
use JetBrains\PhpStorm\Pure;
use Kiri\Abstracts\Logger;
use Kiri\Kiri;
use Psr\Http\Message\ResponseInterface;
use Swoole\Coroutine\Http\Client as SwowClient;
@@ -57,7 +59,7 @@ class Client extends ClientAbstracts
->withHeaders($client->getHeaders())
->withBody(new Stream($client->getBody()));
} catch (\Throwable $exception) {
$this->addError($exception, 'rpc');
Kiri::getDi()->get(Logger::class)->error('rpc', [$exception]);
return (new Response())->withStatus(-1)->withHeaders([])
->withBody(new Stream(jTraceEx($exception)));
}