Skip to content

Commit d9da575

Browse files
committed
MC-41844: Updated Exception handle as per review
1 parent 87c0214 commit d9da575

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

AdobeStockImage/Model/Storage/Save.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Framework\App\Filesystem\DirectoryList;
1212
use Magento\Framework\Exception\AlreadyExistsException;
1313
use Magento\Framework\Exception\FileSystemException;
14+
use Magento\Framework\Exception\InputException;
1415
use Magento\Framework\Filesystem;
1516
use Magento\Framework\Filesystem\Driver\Https;
1617
use Magento\Framework\Filesystem\DriverInterface;
@@ -53,14 +54,15 @@ public function __construct(
5354
* @return string
5455
* @throws AlreadyExistsException
5556
* @throws FileSystemException
57+
* @throws InputException
5658
*/
5759
public function execute(string $imageUrl, string $destinationPath = '') : string
5860
{
5961
$mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA);
6062
$maxFilenameLength = self::MAX_LENGTH;
6163

6264
if (strlen($destinationPath) > $maxFilenameLength) {
63-
throw new AlreadyExistsException(
65+
throw new InputException(
6466
__('Destination path is too long; must be %1 characters or less', $maxFilenameLength)
6567
);
6668
}

0 commit comments

Comments
 (0)