From cf3404aa06e9a044c0c715206e4fbdc9b6b51f8e Mon Sep 17 00:00:00 2001 From: Mangala SSS Khalsa Date: Mon, 17 Feb 2020 19:57:26 -0700 Subject: [PATCH] Store#emit: if storage.emit throws an error, log it instead of hiding it Fixes #187 --- Store.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Store.js b/Store.js index 815b263..df25f28 100644 --- a/Store.js +++ b/Store.js @@ -158,7 +158,11 @@ define([ event.type = type; try { return this.storage.emit(type, event); - } finally { + } + catch (error) { + console.error(error); + } + finally { // Return the initial value of event.cancelable because a listener error makes it impossible // to know whether the event was actually canceled return event.cancelable;