TonyHaikara / silk-platform

0 stars 4 forks source link

JSON import: process interrupted on error #24

Closed ywarnier closed 3 years ago

ywarnier commented 3 years ago

Quand j'importe des "training" et que mon "duration_details" est trop long (+ de 255 caractères), j'ai l'erreur suivante:

Checking the data of entry no. 1
ERROR --- An error occurred while saving the institution in the database :  An exception occurred while executing 'INSERT INTO training [...] 
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'duration_details' at row 1
Checking the data of entry no. 2

In ORMException.php line 145:

  The EntityManager is closed.  

doctrine:fixtures:load [--append] [--group GROUP] [--em EM] [--purger PURGER] [--purge-exclusions PURGE-EXCLUSIONS] [--shard SHARD] [--purge-with-truncate]

L'erreur est claire pour moi, mais au moment de commencer la vérification du "data of entry no. 2", le processus s'interrompt parce que "The EntityManager is closed".

À mon avis, soit on l'interrompt proprement en catchant l'exception et en interrompant le processus avant qu'il ne vérifie l'entrée n° 2, soit on le laisse continuer en réouvrant l'EntityManager...

ywarnier commented 3 years ago

The import process doesn't stop on single errors anymore. See 654d222f108a07a509b44eec1e0a525e101deb9e