From 43c3240d1f600ffd114a849e01db7c88f136cad3 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 31 Mar 2016 13:31:19 -0700 Subject: [PATCH] Report invalid manifest entries --- disks/pc/windows/1.01/manifest.xml | 1 - modules/htmlout/lib/htmlout.js | 27 +++++++++++++-------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/disks/pc/windows/1.01/manifest.xml b/disks/pc/windows/1.01/manifest.xml index 1b9213dff..9dad8aeca 100644 --- a/disks/pc/windows/1.01/manifest.xml +++ b/disks/pc/windows/1.01/manifest.xml @@ -2,7 +2,6 @@ Microsoft Windows 1.01 - Windows 1.01 (SETUP) CGA.DRV diff --git a/modules/htmlout/lib/htmlout.js b/modules/htmlout/lib/htmlout.js index 2b87c2bd8..234898b74 100644 --- a/modules/htmlout/lib/htmlout.js +++ b/modules/htmlout/lib/htmlout.js @@ -659,7 +659,7 @@ HTMLOut.logError = function(err, fForce) { var sError = ""; if (err) { - sError = "htmlout error: " + err.message; + sError = "HTMLOut error: " + err.message; if (fConsole || fForce) HTMLOut.logConsole(sError); } return sError; @@ -1459,6 +1459,15 @@ HTMLOut.prototype.getMachineXML = function(sToken, sIndent, aParms, sXMLFile, sS } } + /* + * If we were called from getManifestXML(), then let's fallback to getMarkdownFile() instead. + */ + if (fFromManifest) { + s = sIndent + "

" + HTMLOut.logError(err) + " (invalid manifest entry)

"; + obj.getMarkdownFile(obj.sFile, sToken, sIndent, aParms, s); + return; + } + /* * If we're still here, one of the following happened: * @@ -1468,23 +1477,13 @@ HTMLOut.prototype.getMachineXML = function(sToken, sIndent, aParms, sXMLFile, sS * * But, instead of displaying a cryptic error message inside our beautiful HTML template, eg: * - * htmlout error: ENOENT, open '/Users/Jeff/Sites/pcjs/devices/pc/machine/5160/cga/256kb/win101/debugger/machine.xml' + * HTMLOut error: ENOENT, open '/Users/Jeff/Sites/pcjs/devices/pc/machine/5160/cga/256kb/win101/debugger/machine.xml' * * we have one more fallback: a random string! Less useful, but more entertaining. Well, maybe not even that. * * s = HTMLOut.logError(err); */ - - /* - * If we were called from getManifestXML(), then let's fallback to getMarkdownFile() instead. - */ - s = obj.getRandomString(sIndent); - if (fFromManifest) { - obj.getMarkdownFile(obj.sFile, sToken, sIndent, aParms, s); - return; - } - - obj.aTokens[sToken] = s; + obj.aTokens[sToken] = obj.getRandomString(sIndent); obj.replaceTokens(); }); }; @@ -1703,7 +1702,7 @@ HTMLOut.prototype.getMarkdownFile = function(sFile, sToken, sIndent, aParms, sPr /* * Instead of displaying a cryptic error message inside our beautiful HTML template, eg: * - * htmlout error: ENOENT, open '/Users/Jeff/Sites/pcjs/devices/pc/machine/5160/cga/256kb/win101/debugger/README.md' + * HTMLOut error: ENOENT, open '/Users/Jeff/Sites/pcjs/devices/pc/machine/5160/cga/256kb/win101/debugger/README.md' * * which is all this will give us: *