mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-22 01:49:05 +02:00
Improved documentation and added example CSV file
This commit is contained in:
parent
2c799d894b
commit
b7aae7d87b
4 changed files with 27 additions and 1 deletions
|
@ -33,6 +33,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
|
|||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Serializer\Exception\NotNormalizableValueException;
|
||||
use UnexpectedValueException;
|
||||
|
||||
class PartImportExportController extends AbstractController
|
||||
|
@ -93,6 +94,9 @@ class PartImportExportController extends AbstractController
|
|||
$errors = $this->entityImporter->importFileAndPersistToDB($file, $options, $entities);
|
||||
} catch (UnexpectedValueException $e) {
|
||||
$this->addFlash('error', 'parts.import.flash.error.invalid_file');
|
||||
if ($e instanceof NotNormalizableValueException) {
|
||||
$this->addFlash('error', $e->getMessage());
|
||||
}
|
||||
goto ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue