Don't send if headers have already been sent
This commit is contained in:
parent
5522c5649a
commit
dda7bacca7
@ -16,13 +16,16 @@ Common.prototype.notReady = function (err, res, p) {
|
||||
Common.prototype.handleErrors = function (err, res) {
|
||||
if (err) {
|
||||
if (err.code) {
|
||||
res.status(400).send(err.message + '. Code:' + err.code);
|
||||
if (!res.headerSent)
|
||||
res.status(400).send(err.message + '. Code:' + err.code);
|
||||
} else {
|
||||
this.log.error(err.stack);
|
||||
res.status(503).send(err.message);
|
||||
if (!res.headerSent)
|
||||
res.status(503).send(err.message);
|
||||
}
|
||||
} else {
|
||||
res.status(404).send('Not found');
|
||||
if (!res.headerSent)
|
||||
res.status(404).send('Not found');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "flosight-api",
|
||||
"description": "A Florincoin blockchain REST and web socket API service for Flocore Node.",
|
||||
"version": "5.0.0-beta.68",
|
||||
"version": "5.0.0-beta.69",
|
||||
"repository": "git://github.com/bitpay/flosight-api.git",
|
||||
"bugs": {
|
||||
"url": "https://github.com/bitpay/flosight-api/issues"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user