fixed VkApiClient
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Library\VK;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
|
||||
@@ -32,7 +33,9 @@ final class VkApiClient
|
||||
$result = json_decode($response->getBody()->getContents(), true);
|
||||
|
||||
if (isset($result['error'])) {
|
||||
throw new Exception("VK API Error: " . $result['error']['error_msg']);
|
||||
$message = "VK API Error: " . $result['error']['error_msg'];
|
||||
Log::error($message);
|
||||
throw new Exception($message);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user