Ignore errors thrown by listeners
This commit is contained in:
@@ -158,7 +158,11 @@ export class EventEmitter<T extends EventMap> {
|
||||
|
||||
// Emit the event to all listeners.
|
||||
listeners.forEach((entry) => {
|
||||
entry.wrappedListener(readonlyPayload);
|
||||
try {
|
||||
entry.wrappedListener(readonlyPayload);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
|
||||
// Return true if there are listeners for the event, false otherwise.
|
||||
|
||||
Reference in New Issue
Block a user