We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems that esbuild will convert js exception info in plugin to string,which is inconvenient to do some logging according to the exception message。
import esbuild from 'esbuild'; const {build} = esbuild class MyException { constructor(code, message,detail){ this.code = code; this.message = message; this.detail = detail } } async function mybuild() { const result = await build({ entryPoints: ['./src/index.js'], bundle: true, sourcemap:true, write:false, format: 'esm', plugins: [{ name: 'esbuild', setup(build){ build.onResolve({filter: /.*/},() => { throw new MyException(10086, 'encode error', {a:1,b:2}) }) } }] }) } async function main(){ try { await mybuild(); }catch(err){ console.log('myerr:', err.message, err.errors[0]) } } main();
which generate the following error info
it would be helpful to adding the origin serialized exception in the error,something like
errors: [{ location: null, text: '[esbuild] encode error', originInfo: JSON.stringify(myexception) }]
which we could parse the originInfo to get originException, so as to do some business logic according to exception
The text was updated successfully, but these errors were encountered:
08ca8cf
Successfully merging a pull request may close this issue.
It seems that esbuild will convert js exception info in plugin to string,which is inconvenient to do some logging according to the exception message。
which generate the following error info
it would be helpful to adding the origin serialized exception in the error,something like
which we could parse the originInfo to get originException, so as to do some business logic according to exception
The text was updated successfully, but these errors were encountered: