Closed Fr33maan closed 1 year ago
What version of async are you using? 3.2.0
Which environment did the issue occur in (Node/browser/Babel/Typescript version)
{ "async": "^3.2.0", "typescript": "4.5.4", "jest": "^27.5.1", "babel-jest": "^27.5.1", "babel-loader": "^8.1.0" }
What did you do? Please include a minimal reproducible case illustrating issue.
test.only('test reflect', async () => { const testFn = async () => { throw { message: 'test error' } } const result = await parallel([reflect(testFn)]) console.log("result: %s", JSON.stringify(result, null, 4)) const testFn2 = async () => { throw new Error('test error') } const result2 = await parallel([reflect(testFn2)]) console.log("result2: %s", JSON.stringify(result2, null, 4)) })
What did you expect to happen? Second call should return the error message or the Error itself in the error property and not hide the Error
Error
error
What was the actual result?
console.log result: [ { "error": { "message": "test error" } } ] console.log result2: [ { "error": {} } ]
Expected behavior due to how JSON.stringify(new Error('hello')) works.
JSON.stringify(new Error('hello'))
What version of async are you using? 3.2.0
Which environment did the issue occur in (Node/browser/Babel/Typescript version)
What did you do? Please include a minimal reproducible case illustrating issue.
What did you expect to happen? Second call should return the error message or the
Error
itself in theerror
property and not hide theError
What was the actual result?