Skip to content

Commit 7419958

Browse files
committed
fix: Direct throw of generic Exception is discouraged
1 parent 866e389 commit 7419958

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/code/Magento/Deploy/Service/DeployPackage.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Deploy\Package\Package;
99
use Magento\Deploy\Package\PackageFile;
1010
use Magento\Framework\App\State as AppState;
11+
use Magento\Framework\Exception\LocalizedException;
1112
use Magento\Framework\Locale\ResolverInterface as LocaleResolver;
1213
use Magento\Framework\View\Asset\ContentProcessorException;
1314
use Magento\Deploy\Console\InputValidator;
@@ -138,7 +139,7 @@ public function deployEmulated(Package $package, array $options, $skipLogging =
138139
$this->errorsCount++;
139140
$this->logger->critical($errorMessage);
140141
$package->deleteFile($file->getFileId());
141-
throw new \Exception($errorMessage);
142+
throw new LocalizedException($errorMessage);
142143
} catch (\Exception $exception) {
143144
$this->logger->critical(
144145
'Compilation from source ' . $file->getSourcePath() . ' failed' . PHP_EOL . (string)$exception

0 commit comments

Comments
 (0)