Skip to content
Snippets Groups Projects
Commit 9288017b authored by rohieb's avatar rohieb
Browse files

brand: fetchStatus network error handling

This continues the server also in case of network errors.
parent d9db3ca6
No related branches found
No related tags found
1 merge request!6brand: integrate opening status in fancy Stratum 0 logo
......@@ -27,8 +27,15 @@ function renderStatus(sock, everything) {
function fetchStatus(cb) {
httpreq.get(URL, function (err, res) {
var state = JSON.parse(res.body).state;
cb(state);
try {
if (err) {
throw new Error('httpreq: ' + err);
}
var state = JSON.parse(res.body).state;
cb(state);
} catch (e) {
console.log('brand: fetchStatus: ' + e);
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment