vk-php-sdk icon indicating copy to clipboard operation
vk-php-sdk copied to clipboard

PHP ошибка Argument 1 passed to VKApiError::__construct() must be of the type array, string given

Open wlf10 opened this issue 5 years ago • 2 comments

В функции parseResponse после обработки в decode_body содержится следующий массив, где error передается не как массив, а как строка

Array ( [error] => ERR_UPLOAD_BAD_IMAGE_SIZE: market photo min size 400x400 [bwact] => do_add [server] => 854320 [_sig] => 0192528750fa266e7558211ed60ccaee )

из-за этого php падает с ошибкой

Uncaught TypeError: Argument 1 passed to VK\Client\VKApiError::__construct() must be of the type array, string given, called in ... VK/Client/VKApiRequest.php on line 131 and defined in ... VK/Client/VKApiError.php:27 Stack trace: #0 ... VK/Client/VKApiRequest.php(131): VK\Client\VKApiError->_construct('ERR_UPLOAD_BAD...') #1 ... VK/Client/VKApiRequest.php(110): VK\Client\VKApiRequest->parseResponse(Object(VK\TransportClient\TransportClientResponse)) #2 xyz.php(2): VK\Client\VKApiRequest->upload('https://pu1-28....', 'file', '/home/c/92524...')

wlf10 avatar Sep 27 '19 05:09 wlf10

Same error

mihan007 avatar Oct 27 '19 13:10 mihan007

У меня совершенно та же ошибка. Она возникает на файлы больше 5МБ. Видео 11МБ я не могу загрузить и фото тоже. Поддержка ВК ничего дельного не ответила.

Удалось побороть проблему?

DaemonLeo avatar Oct 28 '19 07:10 DaemonLeo