Replace when.otherwise() with Promise.catch()

Fixes #1584
This commit is contained in:
Nick O'Leary
2018-01-29 09:50:41 +00:00
parent 1d4a435f20
commit 519edce0ed
6 changed files with 12 additions and 12 deletions

View File

@@ -54,7 +54,7 @@ module.exports = {
} else {
res.json({rev:flowId});
}
}).otherwise(function(err) {
}).catch(function(err) {
log.warn(log._("api.flows.error-reload",{message:err.message}));
log.warn(err.stack);
res.status(500).json({error:"unexpected_error", message:err.message});
@@ -77,7 +77,7 @@ module.exports = {
} else if (version === "v2") {
res.json({rev:flowId});
}
}).otherwise(function(err) {
}).catch(function(err) {
log.warn(log._("api.flows.error-save",{message:err.message}));
log.warn(err.stack);
res.status(500).json({error:"unexpected_error", message:err.message});