When generating an error inside a route handler with
request.reply(Hapi.Error.internal('Error writing to the db.', err));
console output is:
Unmonitored error: hapi, internal, error
undefined
Expected stack trace instead of undefined.
After some digging I found out that the problem is most likely on hapi/lib/request.js:203
console.error('Unmonitored error: ' + item.tags.join(', '));
if (data) {
console.error(data instanceof Error ? data.stack : data);
}
A boom object is an instance of Error, but it has no "stack" property.