From 3378fa980b01cfbdb646dcd3bcba144b984e241f Mon Sep 17 00:00:00 2001 From: zefie Date: Sun, 10 Aug 2025 13:09:19 -0400 Subject: [PATCH] better willie error handling --- .../includes/ServiceVault/wtv-flashrom/big-willie.js | 10 +++++++++- .../includes/ServiceVault/wtv-flashrom/willie.js | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/big-willie.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/big-willie.js index 3287a4bc..b9083cba 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/big-willie.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/big-willie.js @@ -21,7 +21,15 @@ var req = https.request(options, function(res) { headers += "Content-Type: text/html"; sendToClient(socket,headers,data) }); -}); + + res.on('error', function (e) { + if (!minisrv_config.config.debug_flags.quiet) console.log(" * Upstream Big Willies HTTP Error:", e); + var errpage = wtvshared.doErrorPage(400) + headers = errpage[0]; + data = errpage[1]; + sendToClient(socket, headers, data); + }); + req.end(); \ No newline at end of file diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/willie.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/willie.js index f58710a5..665b3f7a 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/willie.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-flashrom/willie.js @@ -35,7 +35,7 @@ const req = https.request(options, function (res) { res.on('error', function (e) { if (!minisrv_config.config.debug_flags.quiet) console.log(" * Upstream Ultra Willies HTTP Error:", e); - var errpage = wtvshared.doErrorPage(400) + var errpage = wtvshared.doErrorPage(400, "A required service is not responding. Please try again in a few moments."); headers = errpage[0]; data = errpage[1]; sendToClient(socket, headers, data); @@ -48,5 +48,6 @@ const req = https.request(options, function (res) { } sendToClient(socket, headers, data); }); + }); req.end();