Skip to content

Commit 365f108

Browse files
committed
Exception added.
1 parent 5648c3b commit 365f108

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Poloniex.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,15 @@ public function returnDepositAddresses($reload = false) {
194194
* @param string $currencyPair In the 'BTC_LTC' format. If no currency pair
195195
* provided - all orders will be returned.
196196
*
197-
* @return array
197+
* @return array Open orders list.
198+
* @throws \Exception If some Poloniex API error occurred.
198199
*/
199200
public function getOpenOrders($currencyPair = null) {
200201
$openOrders = $this->returnOpenOrders();
202+
if (!is_array($openOrders)) {
203+
throw new \Exception("Invalid Poloniex API response");
204+
}
205+
201206
$actualOrders = [];
202207
foreach ($openOrders as $pair => $orders) {
203208
if (empty($orders)) {

0 commit comments

Comments
 (0)