Skip to content

Commit 9f9d641

Browse files
committed
remove exception handling
1 parent 3a9022c commit 9f9d641

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

AdobeStockImageAdminUi/Model/Asset/GetMediaGalleryAssetByAdobeId.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\AdobeStockAssetApi\Model\Asset\Command\LoadByIdsInterface;
1212
use Magento\MediaGalleryApi\Api\GetAssetsByIdsInterface;
1313
use Magento\MediaGalleryApi\Api\Data\AssetInterface;
14-
use Magento\Framework\Exception\LocalizedException;
1514
use Magento\Framework\Reflection\DataObjectProcessor;
1615

1716
/**
@@ -56,17 +55,12 @@ public function __construct(
5655
*
5756
* @param int $adobeId
5857
* @return array
59-
* @throws LocalizedException
6058
*/
6159
public function execute(int $adobeId): array
6260
{
63-
try {
64-
$mediaGalleryId = $this->getAssetByAdobeId->execute([$adobeId])[$adobeId]->getMediaGalleryId();
65-
$asset = $this->getMediaGalleryAssetsById->execute([$mediaGalleryId]);
61+
$mediaGalleryId = $this->getAssetByAdobeId->execute([$adobeId])[$adobeId]->getMediaGalleryId();
62+
$asset = $this->getMediaGalleryAssetsById->execute([$mediaGalleryId]);
6663

67-
return $this->objectProcessor->buildOutputDataArray(current($asset), AssetInterface::class);
68-
} catch (\Exception $e) {
69-
throw new LocalizedException(__($e->getMessage()));
70-
}
64+
return $this->objectProcessor->buildOutputDataArray(current($asset), AssetInterface::class);
7165
}
7266
}

0 commit comments

Comments
 (0)