Skip to content

Commit 22c7b8d

Browse files
authored
Echo definitions have been updated as Exception in httpRequest method by ahmeti
2 parents 6623d98 + f71189f commit 22c7b8d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

php-binance-api.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,8 +1028,7 @@ protected function httpRequest(string $url, string $method = "GET", array $param
10281028
if (curl_errno($curl) > 0) {
10291029
// should always output error, not only on httpdebug
10301030
// not outputing errors, hides it from users and ends up with tickets on github
1031-
echo 'Curl error: ' . curl_error($curl) . "\n";
1032-
return [];
1031+
throw new \Exception('Curl error: ' . curl_error($curl));
10331032
}
10341033

10351034
$header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
@@ -1059,7 +1058,7 @@ protected function httpRequest(string $url, string $method = "GET", array $param
10591058
if(isset($json['msg'])){
10601059
// should always output error, not only on httpdebug
10611060
// not outputing errors, hides it from users and ends up with tickets on github
1062-
echo "signedRequest error: {$output}" . PHP_EOL;
1061+
throw new \Exception('signedRequest error: '.print_r($output, true));
10631062
}
10641063
$this->transfered += strlen($output);
10651064
$this->requestCount++;

0 commit comments

Comments
 (0)