Skip to content

Commit

Permalink
fixes #21 A "conflict" response from API is not handled properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacek Kobus committed Jul 20, 2017
1 parent 100228f commit 5fdb1aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Api/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 5fdb1aa

Please sign in to comment.