Closed xkr47 closed 6 years ago
@xkr47 Thank you for this PR, but is there a test for verifying this patch? Or are there any examples to reproduce to outputting "[object Object]" message?
Sounds like your toString
methods are wrong?
You are right, although it was not exactly "our" toString :)
function Webpack(done) {
const run = require('parallel-webpack').run
const configPath = require.resolve('./webpack/build.js')
run(configPath, {
watch : rawVersion,
maxRetries : 0,
stats : false,
maxConcurrentWorkers: 3
}, done)
}
Changed that next-last line to instead do:
}, (err) => done(err && err.message || err))
and now I get errors nicely passed through!
Sorry for the inconvenience. I did not investigate the problem far enough.
Previously when using
e.error
and it was an object, we got just an "[object Object]" message in the resulting Error object (and error message in terminal). With this patch instead when there is amessage
property insidee.error
, use that to get a better error report, and falling back to old behaviour in other cases.