Skip to content

Commit 698751b

Browse files
committed
Revert parseXmlAsync method back to original signature
1 parent 741a787 commit 698751b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/office-addin-manifest/src/manifestInfo.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ async function modifyManifestXml(manifestPath: string, guid?: string, displayNam
5757
}
5858
}
5959

60-
async function parseXmlAsync(xmlString: string): Promise<Xml> {
60+
async function parseXmlAsync(xmlString: string, manifestPath: string): Promise<Xml> {
6161
return new Promise(async function(resolve, reject) {
6262
xml2js.parseString(xmlString, function(parseError, xml) {
6363
if (parseError) {
64-
reject(new Error(`Unable to parse the xml for manifest file:\n${parseError}`));
64+
reject(new Error(`Unable to parse the manifest file: ${manifestPath}. \n${parseError}`));
6565
} else {
6666
resolve(xml);
6767
}
@@ -81,7 +81,7 @@ export async function readManifestFile(manifestPath: string): Promise<ManifestIn
8181

8282
async function readXmlFromManifestFile(manifestPath: string): Promise<Xml> {
8383
const fileData: string = await readFileAsync(manifestPath, {encoding: "utf8"});
84-
const xml = await parseXmlAsync(fileData);
84+
const xml = await parseXmlAsync(fileData, manifestPath);
8585
return xml;
8686
}
8787

packages/office-addin-manifest/test/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe("Manifest", function() {
2828
} catch (err) {
2929
result = err;
3030
}
31-
assert.equal(result.message, "Unable to parse the xml for manifest file:\nError: Unexpected close tag\nLine: 8\nColumn: 46\nChar: >");
31+
assert.equal(result.message, "Unable to parse the manifest file: test/manifests/manifest.incorrect-end-tag.xml. \nError: Unexpected close tag\nLine: 8\nColumn: 46\nChar: >");
3232
});
3333
it("should handle a missing description", async function() {
3434
const info = await manifestInfo.readManifestFile("test/manifests/manifest.no-description.xml");

0 commit comments

Comments
 (0)