diff --git a/app/Library/VK/VkApiClient.php b/app/Library/VK/VkApiClient.php index 5132f6a..b78f386 100644 --- a/app/Library/VK/VkApiClient.php +++ b/app/Library/VK/VkApiClient.php @@ -29,10 +29,12 @@ final class VkApiClient ]), ]); + $result = json_decode($response->getBody()->getContents(), true); + if (isset($result['error'])) { throw new Exception("VK API Error: " . $result['error']['error_msg']); } - return json_decode($response->getBody()->getContents(), true); + return $result; } }