We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5648c3b commit 365f108Copy full SHA for 365f108
src/Poloniex.php
@@ -194,10 +194,15 @@ public function returnDepositAddresses($reload = false) {
194
* @param string $currencyPair In the 'BTC_LTC' format. If no currency pair
195
* provided - all orders will be returned.
196
*
197
- * @return array
+ * @return array Open orders list.
198
+ * @throws \Exception If some Poloniex API error occurred.
199
*/
200
public function getOpenOrders($currencyPair = null) {
201
$openOrders = $this->returnOpenOrders();
202
+ if (!is_array($openOrders)) {
203
+ throw new \Exception("Invalid Poloniex API response");
204
+ }
205
+
206
$actualOrders = [];
207
foreach ($openOrders as $pair => $orders) {
208
if (empty($orders)) {
0 commit comments