Skip to content

Error Stack Trace is not printed to the console #809

@dypsilon

Description

@dypsilon

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.

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions