I'm chaining two mongoose calls in one route in express. With just one call, if there's an error it "magically" bubbles up to console.log. If the second call fails it does so silently, there's no console log or in the POST response.
Code:
function handleRequest(req, res) {
return SchemaName.updateOne()
.then(item => SchemaName.findOneAndUpdate())
.catch(err => res.status(500).send(err))
}
I've tried every combination of promises, return values, async/await, and am pretty sure I'm missing something in the middleware now. Anyone know what's going on here?