From 25f68eb23dd53083e84608e2b1af2109d6a260ac Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 22 Jul 2024 10:43:21 +0200 Subject: Allow failing modules if they miss data files --- modules/proxy/proxy.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules/proxy') diff --git a/modules/proxy/proxy.js b/modules/proxy/proxy.js index 49caf54..ccec53a 100644 --- a/modules/proxy/proxy.js +++ b/modules/proxy/proxy.js @@ -29,9 +29,15 @@ function objectFromList(l){ } module.exports=function(app,io,moddir){ - var iddict=objectFromList( + var iddict; + try { + iddict=objectFromList( fs.readFileSync(moddir+"/idfile.txt").toString() .split("\n").map(function(r){return r.split(" ");})); + } catch (e) { + console.error(e); + return false; + } app.all("/proxy/:id/*",function(req,res){ var id=req.params.id; -- cgit v1.2.3-70-g09d2