Closed hklages closed 3 years ago
You can also add .catch((err)=> console.warn(err))
that will make sure it won’t error out.
I was not precise enough. What I meant: Is there a way to hand over a rejected promise to the routine where the event handler is set up. The try/catch or .catch() - if there are only a few critical command - are ok. So we can close this.
Is there any other way / good practice to handle promise rejections inside event emitter function? I would like to get rid of the try..catch. But when removing them, the unhandled promise rejections are not given back to the calling asyncSubscribeToMultipleEvents.
Currently I call a wrapper asyncSubscribeToMultipleEvents to subscribe
and then