You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2022/05/04 20:22:34 UTC

[whimsy] branch master updated: Detect page load failure

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new dd731c9d Detect page load failure
dd731c9d is described below

commit dd731c9d8020580a822c842219d4d71c85473c02
Author: Sebb <se...@apache.org>
AuthorDate: Wed May 4 21:22:29 2022 +0100

    Detect page load failure
---
 tools/scan-page.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/scan-page.js b/tools/scan-page.js
index 714b6a5d..fb3ff341 100755
--- a/tools/scan-page.js
+++ b/tools/scan-page.js
@@ -51,6 +51,12 @@ if (!isASFhost(inithost)) {
         }
     }
   });
-  await page.goto(target);
+  let result = await page.goto(target);
+  let status = result._status;
+  if (status != 200) {
+    let url = result._url;
+    let error = `Status ${status} for ${url}`;
+    throw new Error(error);
+  }
   await browser.close();
 })();