From fe4dc4e25abe2f716fdbe3abee6768710ddacc5e Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Mon, 17 Jul 2017 05:50:45 +0200 Subject: [PATCH] poloniex: do not throw exceptions on curl errors --- web/yaamp/core/exchange/poloniex.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/yaamp/core/exchange/poloniex.php b/web/yaamp/core/exchange/poloniex.php index 8133885..4eab414 100644 --- a/web/yaamp/core/exchange/poloniex.php +++ b/web/yaamp/core/exchange/poloniex.php @@ -49,12 +49,16 @@ class poloniex curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); + curl_setopt($ch, CURLOPT_TIMEOUT, 40); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // run the query $res = curl_exec($ch); - if ($res === false) throw new Exception('Curl error: '.curl_error($ch)); + if ($res === false) { + debuglog('poloniex: curl error '.curl_error($ch)); + return false; + } //echo $res; $dec = json_decode($res, true); if (!$dec){