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.