Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object of class GuzzleHttp\\Psr7\\Response could not be converted to string #61

Open
elementfani opened this issue Dec 10, 2019 · 0 comments

Comments

@elementfani
Copy link

В строке 208 метода \MoySklad\Components\Http\MoySkladHttpClient::makeRequest вызывается исключение throw new ResponseParseException($res);, в котором $res является объектом класса \GuzzleHttp\Psr7\Response.

Далее в конструкторе класса \MoySklad\Exceptions\ResponseParseException есть код "Response decode error: " . $message, в котором $message является объектом класса \GuzzleHttp\Psr7\Response.

Класс \GuzzleHttp\Psr7\Response не имеет метода __toString(), поэтому выполнение падает с ошибкой:

"Object of class GuzzleHttp\Psr7\Response could not be converted to string"

file: .../vendor/tooyz/moysklad/src/Exceptions/ResponseParseException.php
line: 16
trace:
0 .../vendor/tooyz/moysklad/src/Exceptions/ResponseParseException.php(16): yii\base\ErrorHandler->handleError(4096, 'Object of class...', '/var/www/...', 16, Array)
#1 .../vendor/tooyz/moysklad/src/Components/Http/MoySkladHttpClient.php(208): MoySklad\Exceptions\ResponseParseException->__construct(Object(GuzzleHttp\Psr7\Response))
#2 .../vendor/tooyz/moysklad/src/Components/Http/MoySkladHttpClient.php(52): MoySklad\Components\Http\MoySkladHttpClient->makeRequest('GET', 'report/stock/al...', Array, Object(MoySklad\Components\Http\RequestConfig))
#3 .../vendor/tooyz/moysklad/src/Entities/Reports/AbstractReport.php(29): MoySklad\Components\Http\MoySkladHttpClient->get('report/stock/al...', Array)
#4 .../vendor/tooyz/moysklad/src/Entities/Reports/StockReport.php(13): MoySklad\Entities\Reports\AbstractReport::queryWithParam(Object(MoySklad\MoySklad), 'all', Object(MoySklad\Components\Specs\QuerySpecs\Reports\StockReportQuerySpecs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant