diff --git a/app/code/Magento/TaxImportExport/Model/Rate/CsvImportHandler.php b/app/code/Magento/TaxImportExport/Model/Rate/CsvImportHandler.php index 8ec871a182ab4..c8cba30c9cd25 100644 --- a/app/code/Magento/TaxImportExport/Model/Rate/CsvImportHandler.php +++ b/app/code/Magento/TaxImportExport/Model/Rate/CsvImportHandler.php @@ -237,7 +237,7 @@ protected function _importRate(array $rateData, array $regionsCache, array $stor $countryCode = $rateData[1]; $country = $this->_countryFactory->create()->loadByCode($countryCode, 'iso2_code'); if (!$country->getId()) { - throw new \Magento\Framework\Exception\LocalizedException(__('One of the countries has invalid code.')); + throw new \Magento\Framework\Exception\LocalizedException(__('Country code is invalid: %1', $countryCode)); } $regionsCache = $this->_addCountryRegionsToCache($countryCode, $regionsCache); diff --git a/app/code/Magento/TaxImportExport/i18n/en_US.csv b/app/code/Magento/TaxImportExport/i18n/en_US.csv index cadecc39a391c..40db8846b54cb 100644 --- a/app/code/Magento/TaxImportExport/i18n/en_US.csv +++ b/app/code/Magento/TaxImportExport/i18n/en_US.csv @@ -12,7 +12,7 @@ Rate,Rate "Invalid file upload attempt","Invalid file upload attempt" "Invalid file upload attempt.","Invalid file upload attempt." "Invalid file format.","Invalid file format." -"One of the countries has invalid code.","One of the countries has invalid code." +"Country code is invalid: %1","Country code is invalid: %1" "Import Tax Rates","Import Tax Rates" "Export Tax Rates","Export Tax Rates" CSV,CSV diff --git a/dev/tests/integration/testsuite/Magento/TaxImportExport/Model/Rate/CsvImportHandlerTest.php b/dev/tests/integration/testsuite/Magento/TaxImportExport/Model/Rate/CsvImportHandlerTest.php index ed7613f3dd106..6c2c291e6c295 100644 --- a/dev/tests/integration/testsuite/Magento/TaxImportExport/Model/Rate/CsvImportHandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/TaxImportExport/Model/Rate/CsvImportHandlerTest.php @@ -57,7 +57,7 @@ public function testImportFromCsvFileWithCorrectData() /** * @magentoDbIsolation enabled * @expectedException \Magento\Framework\Exception\LocalizedException - * @expectedExceptionMessage One of the countries has invalid code. + * @expectedExceptionMessage Country code is invalid: ZZ */ public function testImportFromCsvFileThrowsExceptionWhenCountryCodeIsInvalid() {