error sending empty object express

JavaScript
return res.status(401).send({ error : err.message });
Source

Also in JavaScript: