fix: don't overwrite global constructor names in remote (#20637)
* fix: don't overwrite global constructor names in remote * fake constructor names better, and improve error serialization
This commit is contained in:
parent
820dab295f
commit
b155ebeeb3
3 changed files with 26 additions and 10 deletions
|
@ -498,17 +498,16 @@ ifdescribe(features.isRemoteModuleEnabled())('remote module', () => {
|
|||
it('throws errors from the main process', () => {
|
||||
expect(() => {
|
||||
throwFunction()
|
||||
}).to.throw()
|
||||
}).to.throw(/undefined/)
|
||||
})
|
||||
|
||||
it('throws custom errors from the main process', () => {
|
||||
const err = new Error('error')
|
||||
err.cause = new Error('cause')
|
||||
err.prop = 'error prop'
|
||||
it('tracks error cause', () => {
|
||||
try {
|
||||
throwFunction(err)
|
||||
} catch (error) {
|
||||
expect(error.cause).to.deep.equal(...resolveGetters(err))
|
||||
throwFunction(new Error('error from main'))
|
||||
expect.fail()
|
||||
} catch (e) {
|
||||
expect(e.message).to.match(/Could not call remote function/)
|
||||
expect(e.cause.message).to.equal('error from main')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue