mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-05 09:04:19 +01:00
N°4652 Better error message when XML node define fails from delta (#256)
N°4652 Add more details when trying to define an already existing XML node Co-authored-by: Molkobain <guillaume.lajarige@combodo.com> Co-authored-by: Pierre Goiffon <pierre.goiffon@combodo.com>
This commit is contained in:
@@ -2177,8 +2177,13 @@ class MFElement extends Combodo\iTop\DesignElement
|
||||
if ($oExisting->getAttribute('_alteration') != 'removed') {
|
||||
$sPath = MFDocument::GetItopNodePath($oNode);
|
||||
$iLine = $oNode->getLineNo();
|
||||
throw new MFException($sPath.' at line '.$iLine.": could not be added (already exists)", MFException::COULD_NOT_BE_ADDED,
|
||||
$iLine, $sPath);
|
||||
$sExistingPath = MFDocument::GetItopNodePath($oExisting);
|
||||
$iExistingLine = $oExisting->getLineNo();
|
||||
|
||||
$sExceptionMessage = <<<EOF
|
||||
`{$sPath}` at line {$iLine} could not be added : already exists in `{$sExistingPath}` at line {$iExistingLine}
|
||||
EOF;
|
||||
throw new MFException($sExceptionMessage, MFException::COULD_NOT_BE_ADDED, $iLine, $sPath);
|
||||
}
|
||||
$oExisting->ReplaceWithSingleNode($oNode);
|
||||
$sFlag = 'replaced';
|
||||
|
||||
Reference in New Issue
Block a user