diff --git a/configmanager/server.js b/configmanager/server.js index b5ff457..bd79cff 100644 --- a/configmanager/server.js +++ b/configmanager/server.js @@ -28,7 +28,10 @@ app.get('/:namespace/:application', (req, res) => { } else { // If the file exists, read its contents and return as JSON object fs.readFile(defaultFilePath, 'utf8', (err, data) => { - if (err) throw err; + if (err) { + console.warn("Default decoy config file is missing !"); + return res.json([]); + } if(!data) return res.json([]) const json = JSON.parse(data); res.json(json); @@ -38,7 +41,10 @@ app.get('/:namespace/:application', (req, res) => { } else { // If the file exists, read its contents and return as JSON object fs.readFile(filePath, 'utf8', (err, data) => { - if (err) throw err; + if (err) { + console.warn("Decoy config file is missing !"); + return res.json([]); + } if(!data) return res.json([]) const json = JSON.parse(data); res.json(json);