flosight-api/lib/common.js
Patrick Nagurny 54462019be remove files
2015-09-02 11:45:51 -04:00

20 lines
399 B
JavaScript

'use strict';
exports.notReady = function (err, res, p) {
res.status(503).send('Server not yet ready. Sync Percentage:' + p);
};
exports.handleErrors = function (err, res) {
if (err) {
if (err.code) {
res.status(400).send(err.message + '. Code:' + err.code);
}
else {
res.status(503).send(err.message);
}
}
else {
res.status(404).send('Not found');
}
};