You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
282 B
16 lines
282 B
'use strict';
|
|
|
|
|
|
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');
|
|
}
|
|
};
|
|
|