From 5fdb1aad7fa905f959fc94587cabde3d2c3f60d6 Mon Sep 17 00:00:00 2001 From: Jacek Kobus Date: Thu, 20 Jul 2017 12:30:01 +0200 Subject: [PATCH] fixes #21 A "conflict" response from API is not handled properly --- src/Api/Asset.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Api/Asset.php b/src/Api/Asset.php index d0e954b..43f19b7 100644 --- a/src/Api/Asset.php +++ b/src/Api/Asset.php @@ -43,14 +43,14 @@ public function create(string $projectKey, string $id) return $response; } - if ($response->getStatusCode() !== 201) { - $this->handleErrors($response); - } - if ($response->getStatusCode() === 409) { throw Exception\Domain\AssetConflictException::create($id); } + if ($response->getStatusCode() !== 201) { + $this->handleErrors($response); + } + return $this->hydrator->hydrate($response, AssetModel::class); }