Hi, in our company we recently updated the @nestjs/event-emitter package, and it quite hit us by surprise that in v2.0.1 all errors thrown inside an emitted event will be suppressed (see PR: https://github.com/nestjs/event-emitter/pull/936)
Luckily one of our tests failed, where we actually expected an exception to be thrown, otherwise we wouldn't have noticed. I would like to understand the reason behind this, how suppressing errors is considered to be the default behaviour? I saw this post from Kamil here (https://github.com/nestjs/event-emitter/issues/932#issuecomment-1678524538), were he explained that "Thrown errors where causing the host application to crash", but I don't fully understand why. If I throw an error inside an emitted event (with suppressErrors: false), it will correctly be catched by our ExceptionFilter where we can then handle the error. With suppressErrors: true it will just get logged, and your application will just ignore that some error happened, which again I cannot understand how this is the default behaviour. Maybe there are more reasons to this that I don't know about? Please let me know about your opinion and reasons behind this 🙂
What we ended up doing now, is to extend the original OnEvent decorator with our own one, which will set suppressErrors: true by default and we restrict importing the original one with an eslint rule. Not ver nice, but better to always set the boolean value manually, which might get forgotten by developers.