N°7343 Catch ParseError when loading dict files in setup (#615)

This commit is contained in:
Pierre Goiffon
2024-03-12 18:05:38 +01:00
committed by GitHub
parent 2922b22478
commit a5efd981d8

View File

@@ -932,10 +932,12 @@ class ModelFactory
$this->aDictKeys[$sLanguageCode][$sCode] = $oXmlEntry;
}
}
}
catch (Exception $e)
} catch (Exception|Error $e) // Error can occurs on eval() calls
{
throw new Exception('Failed to load dictionary file "'.$sPHPFile.'", reason: '.$e->getMessage());
throw new DictException('Failed to load dictionary file "' . $sPHPFile . '"', [
'exception_class' => get_class($e),
'exception_msg' => $e->getMessage(),
]);
}
}