a8m/doqmentdb

Augment the Error object with properties that explain details

petetnt opened this issue · 0 comments

I am catching an error and sending a response with Express + DoqmentDB like this:

foo.create({
  foo: bar
}).then(function () {
  res.json("Success");
}).catch(function (err) {
  res.status(500).json(err);
});

The object is just:

[Error: Invalid value in: `foo`]

What I would like to see is something similar to this section in the developers/node/design guide, where the error object is augmented with a name, message and the stack trace.