Skip to content

Commit fc3b4a3

Browse files
author
Leonid Poluyanov
committed
MAGETWO-53781: Ajax loader doesn't stop if customer uses incorrect file type during import
1 parent a96bd61 commit fc3b4a3

File tree

1 file changed

+3
-1
lines changed
  • app/code/Magento/ImportExport/Controller/Adminhtml/Import

1 file changed

+3
-1
lines changed

app/code/Magento/ImportExport/Controller/Adminhtml/Import/Validate.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ public function execute()
4848
$data[$import::FIELD_FIELD_SEPARATOR]
4949
);
5050
$this->processValidationResult($import->validateSource($source), $resultBlock);
51+
} catch (\Magento\Framework\Exception\LocalizedException $e) {
52+
$resultBlock->addError($e->getMessage());
5153
} catch (\Exception $e) {
52-
$resultBlock->addError(__($e->getMessage()));
54+
$resultBlock->addError(__('Sorry, but the data is invalid or the file is not uploaded.'));
5355
}
5456
return $resultLayout;
5557
} elseif ($this->getRequest()->isPost() && empty($_FILES)) {

0 commit comments

Comments
 (0)