@@ -302,6 +302,9 @@ public function generateUrl($urlParams = array(), $customAction = null)
302
302
*
303
303
* @uses HttpRequestJson::get() to send the HTTP request
304
304
*
305
+ * @throws ApiException if the response has an error specified
306
+ * @throws CurlException if response received with unexpected HTTP code.
307
+ *
305
308
* @return array
306
309
*/
307
310
public function get ($ urlParams = array (), $ url = null , $ dataKey = null )
@@ -321,6 +324,10 @@ public function get($urlParams = array(), $url = null, $dataKey = null)
321
324
*
322
325
* @param array $urlParams Check Shopify API reference of the specific resource for the list of URL parameters
323
326
*
327
+ * @throws SdkException
328
+ * @throws ApiException if the response has an error specified
329
+ * @throws CurlException if response received with unexpected HTTP code.
330
+ *
324
331
* @return integer
325
332
*/
326
333
public function count ($ urlParams = array ())
@@ -340,6 +347,8 @@ public function count($urlParams = array())
340
347
* @param mixed $query
341
348
*
342
349
* @throws SdkException if search is not enabled for the resouce
350
+ * @throws ApiException if the response has an error specified
351
+ * @throws CurlException if response received with unexpected HTTP code.
343
352
*
344
353
* @return array
345
354
*/
@@ -365,6 +374,9 @@ public function search($query)
365
374
*
366
375
* @uses HttpRequestJson::post() to send the HTTP request
367
376
*
377
+ * @throws ApiException if the response has an error specified
378
+ * @throws CurlException if response received with unexpected HTTP code.
379
+ *
368
380
* @return array
369
381
*/
370
382
public function post ($ dataArray , $ url = null , $ wrapData = true )
@@ -387,6 +399,9 @@ public function post($dataArray, $url = null, $wrapData = true)
387
399
*
388
400
* @uses HttpRequestJson::put() to send the HTTP request
389
401
*
402
+ * @throws ApiException if the response has an error specified
403
+ * @throws CurlException if response received with unexpected HTTP code.
404
+ *
390
405
* @return array
391
406
*/
392
407
public function put ($ dataArray , $ url = null , $ wrapData = true )
@@ -409,6 +424,9 @@ public function put($dataArray, $url = null, $wrapData = true)
409
424
*
410
425
* @uses HttpRequestJson::delete() to send the HTTP request
411
426
*
427
+ * @throws ApiException if the response has an error specified
428
+ * @throws CurlException if response received with unexpected HTTP code.
429
+ *
412
430
* @return array an empty array will be returned if the request is successfully completed
413
431
*/
414
432
public function delete ($ urlParams = array (), $ url = null )
@@ -493,7 +511,7 @@ public function processResponse($responseArray, $dataKey = null)
493
511
if (isset ($ responseArray ['errors ' ])) {
494
512
$ message = $ this ->castString ($ responseArray ['errors ' ]);
495
513
496
- throw new ApiException ($ message );
514
+ throw new ApiException ($ message, CurlRequest:: $ lastHttpCode );
497
515
}
498
516
499
517
if ($ dataKey && isset ($ responseArray [$ dataKey ])) {
0 commit comments