From 5d94058f591c2d8297a5e2ec3ed647147812e374 Mon Sep 17 00:00:00 2001 From: Reindert Date: Mon, 17 Jul 2017 13:36:22 +0200 Subject: [PATCH] 1.1.7 Check API key before creating a shipment --- src/Model/MyParcelRequest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Model/MyParcelRequest.php b/src/Model/MyParcelRequest.php index 102ae09b..cc89db33 100644 --- a/src/Model/MyParcelRequest.php +++ b/src/Model/MyParcelRequest.php @@ -198,6 +198,7 @@ public function sendRequest($method = 'POST', $uri = self::REQUEST_TYPE_SHIPMENT $request->close(); if ($this->getError()) { + throw new \Exception('Error in MyParcel API request: ' . $this->getError() . ' Url: ' . $url . ' Request: ' . $this->body); } return $this;