Skip to content

No way to raise async errors in a reporter #4057

@WilcoFiers

Description

@WilcoFiers

While axe-core allows for async reporters, if there is an async error axe doesn't surface that error properly when using the callback:

axe.addReporter('throwing', async (results, options, resolve, reject) => {
  await new Promise(r => setTimeout(r, 100))
  reject(new Error('Something went wrong'));
})

axe.run({ reporter: 'throwing' }, (err, results) => {
  results // This is a promise that will reject
});

By some fortunate accident in the code this does work when you're using await axe.run({ reporter: 'throwing' }).

expected: If a reporter throws an async error like happens above, that error gets passed to the err argument of the callback.

Metadata

Metadata

Assignees

Labels

coreIssues in the core code (lib/core)fixBug fixes

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions