Scrabouillmax/Birdie_technical_test

Error handling

Opened this issue · 0 comments

app.get('/info/:variable', function (req, res) {
getDataSize(req.params["variable"])
.then(dataSize => {
return getData(req.params["variable"])
.then(data => {
return {
n_total_lines: dataSize.n_total_lines,
content: data.content
}
})
})
.then(infos => {
res.json(infos);
})
})
// returns the list of all variables
app.get('/variables', function (req, res) {
getVariables()
.then(variables => res.json(variables));
})

Hi, i'm one of the developers from Birdie. I just want to ask a few questions concerning your code as I review it.

What would happen if something went wrong with one of these calls?