Skip to content

Commit

Permalink
webgui: Handle the case a customer is not present in the db
Browse files Browse the repository at this point in the history
Instead of just crashing, render a page with unknown amounts when a
customer is not present in the database. This partially addresses #55,
although it would be good if the UI had more information in this
case. This should not cause issues with purchases or transfers, since
those routes already check if the user is from a known IP independently.
  • Loading branch information
matt9j committed Jun 7, 2021
1 parent c6cab9d commit 41680e2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions webgui/routes/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ router.get('/', function(req, res, next) {
admin: data[0].admin,
services: app.services,
});
}).catch(error => {
res.render('status', {
translate: app.translate,
title: app.translate("Home"),
raw_up_str: 0,
raw_down_str: 0,
balance: 0,
data_balance_str: "unknown",
msisdn: "uknown",
admin: false,
services: app.services,
});
});
});

Expand Down

0 comments on commit 41680e2

Please sign in to comment.