Skip to content
Snippets Groups Projects
Commit f763cf4b authored by Jonathan Foucher's avatar Jonathan Foucher
Browse files

throw php errors as exceptions

parent 85006b6f
No related branches found
No related tags found
No related merge requests found
Pipeline #60173 passed
......@@ -17,6 +17,7 @@ framework:
#fragments: true
php_errors:
log: true
throw: true
validation:
mapping:
......
......@@ -357,11 +357,10 @@ class ModeleAnalyseController extends CRUDController
$form = $this->createForm(ImportModeleType::class);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$content = file_get_contents($form->getData()['file']->getPathname());
$serializer = SerializerBuilder::create()->build();
/** @var ModeleAnalyse $object */
$content = file_get_contents($form->getData()['file']->getPathname());
try {
$serializer = SerializerBuilder::create()->build();
/** @var ModeleAnalyse $object */
$object = $serializer->deserialize($content, ModeleAnalyse::class, 'xml');
$object->deserialize();
} catch (\Exception $e) {
......
......@@ -422,8 +422,8 @@ class ReferentielController extends CRUDController
if ($form->isSubmitted() && $form->isValid()) {
$content = file_get_contents($form->getData()['file']->getPathname());
$serializer = SerializerBuilder::create()->build();
/** @var Model\Referentiel $object */
/* @var Model\Referentiel $object */
try {
$object = $serializer->deserialize($content, Model\Referentiel::class, 'xml');
$object->deserialize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment