The use case is: I have an event handler that does some processing. It calls a function which returns a promise. I need a guarantee that the function eventually completes or fails, however, I do not need to do any additional processing afterwards. This appears to work but it looks like bad practice:
function onMyEvent() {
return promisifiedFunction()
.catch( //log error );
}
function someFunction() {
emit(‘myevent’);
}
Is this bad practice to have catch without then? It seems to work fine.
I did not think I needed a return
either as I could fire-and-forget but I think it's needed if I want to catch the error