Currently, when you call emit()
you can attache .catch()
to the returned Promise for error handling. It has a limitation coming from Promise side as Promise can be only once resolved or rejected. But you can have multiple listeners for the event and if multiple listneres errors out then you will be notified only about the first one.
I would like to propose to have defined event name (error
seems like good name and follows also similar event in the Node's EventEmitter
) which would be called upon listener's error throw or rejection with the object passed with structure:
{
event: string // name of the event of the listener that throw the error
error: Error object
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too