🎨 Improve error message in patchmanifest verification
This commit is contained in:
parent
7ee70e8a2b
commit
7b027e9c69
1 changed files with 6 additions and 3 deletions
|
@ -133,10 +133,13 @@ export default function verifyPatchmanifest(manifestFile: xmlJs.Element, product
|
|||
throw new Error('Expected To element.');
|
||||
}
|
||||
//TODO: check if From and To are valid relations
|
||||
//<ExtraDataItem>
|
||||
//<ExtraData>
|
||||
const ExtraData = ReleaseUpdatePath.elements[2];
|
||||
if (ExtraData.type !== 'element' || ExtraData.name !== 'ExtraData' || ExtraData.attributes !== undefined || ExtraData.elements === undefined) {
|
||||
throw new Error('Expected ExtraData element.');
|
||||
if (ExtraData.type !== 'element' || ExtraData.name !== 'ExtraData') {
|
||||
throw new Error(`Expected ExtraData element in patch ${From.elements[0].text}to${To.elements[0].text}.`);
|
||||
}
|
||||
if (ExtraData.attributes !== undefined || ExtraData.elements === undefined) {
|
||||
throw new Error(`Expected ExtraData element with no attributes but some children in patch ${From.elements[0].text}to${To.elements[0].text}.`);
|
||||
}
|
||||
for (let j = 0, jl = ExtraData.elements.length; j < jl; j += 1) {
|
||||
//<ExtraDataItem>
|
||||
|
|
Loading…
Reference in a new issue