Skip to content

Commit

Permalink
Merge pull request #22 from jkobus/issue-21
Browse files Browse the repository at this point in the history
fixes #21 A "conflict" response from API is not handled properly
  • Loading branch information
Nyholm authored Jul 21, 2017
2 parents cdefe46 + 5fdb1aa commit 39109fd
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 39109fd

Please sign in to comment.