Skip to content

Commit f71189f

Browse files
committed
Echo definitions have been updated as Exception in httpRequest method.
1 parent 5d41478 commit f71189f

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
@@ -1003,8 +1003,7 @@ protected function httpRequest(string $url, string $method = "GET", array $param
10031003
if (curl_errno($curl) > 0) {
10041004
// should always output error, not only on httpdebug
10051005
// not outputing errors, hides it from users and ends up with tickets on github
1006-
echo 'Curl error: ' . curl_error($curl) . "\n";
1007-
return [];
1006+
throw new \Exception('Curl error: ' . curl_error($curl));
10081007
}
10091008

10101009
$header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
@@ -1026,7 +1025,7 @@ protected function httpRequest(string $url, string $method = "GET", array $param
10261025
if(isset($json['msg'])){
10271026
// should always output error, not only on httpdebug
10281027
// not outputing errors, hides it from users and ends up with tickets on github
1029-
echo "signedRequest error: {$output}" . PHP_EOL;
1028+
throw new \Exception('signedRequest error: '.print_r($output, true));
10301029
}
10311030
$this->transfered += strlen($output);
10321031
$this->requestCount++;

0 commit comments

Comments
 (0)