Skip to content

Cucumber does not support Error cause.Β #2515

@HermansJarno

Description

@HermansJarno

πŸ‘“ What did you see?

Error cause is lost in format_error and cucumber/pretty-formatter does not print causes.

At our project we log errors with causes, but the cause is filtered out by cucumber.
I noticed this happens in format_error where a new error is built in the exception property.

I manually added in my node_modules for cucumber in format_error.js (just to test) the cause. Next, I still saw that the cause was ignored, hence it being emitted on the envelope.

The reason we log causes is because we wrapped cucumber to work with our own testing framework. We work with the cucumber/api

βœ… What did you expect to see?

We expect the cause to be emitted by cucumber, and if possible, also be formatted by the pretty-formatter.

πŸ“¦ Which tool/library version are you using?

node v18.20.2
cucumber ^v11.1

πŸ”¬ How could we reproduce it?

try {
throw new Error('Original cause error')
}
catch(e) {
throw new Error('message', { cause: e })
}

πŸ“š Any additional context?

No response

Metadata

Metadata

Assignees

Labels

βœ… acceptedThe core team has agreed that it is a good idea to fix this⚑ enhancementRequest for new functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions