mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-25 19:09:49 +00:00
Throw an exception if canopy does not return a product
This commit is contained in:
parent
a67f106bc6
commit
a7a1026f9b
1 changed files with 4 additions and 0 deletions
|
|
@ -202,6 +202,10 @@ class CanopyProvider implements InfoProviderInterface
|
|||
$product = $response->toArray()['data']['amazonProduct'];
|
||||
|
||||
|
||||
if ($product === null) {
|
||||
throw new \RuntimeException("Product with ASIN $id not found");
|
||||
}
|
||||
|
||||
return new PartDetailDTO(
|
||||
provider_key: $this->getProviderKey(),
|
||||
provider_id: $product['asin'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue