Open fcaps opened 9 months ago
@fcaps Is so strange... all this errors are covered by lot of tests.
@zazoomauro when I "fix" the issue, some tests fail with a ServiceNotFoundException. was not looking at other tests, but chances are high that they throw a RangeError or something.
here a quick test:
//ContainerBuilder.spec.js
chai.use(require('chai-as-promised'))
it('should re-throw errors from failing compiler pass', async () => {
class CompilerPass {
async process () {
throw Error('catch me if you can')
}
}
container.addCompilerPass(new CompilerPass())
await expect(container.compile()).to.be.rejectedWith(Error)
})
@fcaps feel free to fix it.
Hey,
don't know if this was by mistake, but the Compiler is swallowing all Errors other than RangeError, took me a while to debug this.
the original compile from was re-throwing:
looking at the code, compiling a frozen container should also thrown an Error imo.