Skip to content

[Feature Request]: expose error information on JS API error object #1956

@yyx990803

Description

@yyx990803

What problem does this feature solve?

When there is an error from API-based usage, e.g. a missing export:

try {
  const bundle = await rolldown({
    input: '...'
  })
  const generated = await bundle.generate({ format: 'cjs' })
} catch (e) {
  console.log(e) // e doesn't expose anything useful
}

The error message is printed to the console, but the caught error object doesn't contain the same information. e.message is "Build failed" and e.code is "GenericFailure" - which are not really helpful.

What does the proposed API look like?

e.message and e.code should contain more specific information.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions