summaryrefslogtreecommitdiff
path: root/modules/proxy
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2024-07-22 10:43:21 +0200
committerTom Smeding <t.j.smeding@uu.nl>2024-07-22 10:43:21 +0200
commit25f68eb23dd53083e84608e2b1af2109d6a260ac (patch)
tree1d3f7e8b64e5cac8c23dc57bb68b214e26c77569 /modules/proxy
parent9a41d980622b449d41999dc8f46226c1879e00ef (diff)
Allow failing modules if they miss data files
Diffstat (limited to 'modules/proxy')
-rw-r--r--modules/proxy/proxy.js8
1 files changed, 7 insertions, 1 deletions
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;