diff --git a/src/ssn/verify/verifyPatchmanifest.ts b/src/ssn/verify/verifyPatchmanifest.ts index 3bb7cf6..dab27b5 100644 --- a/src/ssn/verify/verifyPatchmanifest.ts +++ b/src/ssn/verify/verifyPatchmanifest.ts @@ -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 - // + // 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) { //