From 85e488bbe68bb4e6d65490618f54916627ee6803 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 5 Jul 2017 11:37:22 +0200 Subject: [PATCH] Throw proper error stack when observer function thrown an error - implements #75 --- package.json | 2 +- src/Utils.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 17887718..2dbea11e 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "lint": "standard", "dist": "rollup -c rollup.dist.js", - "serve": "concurrently 'serve examples' 'rollup -wc rollup.dist.js -o examples/bower_components/yjs/y.js'" + "serve": "concurrently 'serve ..' 'rollup -wc rollup.dist.js -o examples/bower_components/yjs/y.js'" }, "pre-commit": [ "lint", diff --git a/src/Utils.js b/src/Utils.js index c18f112a..a62caa3c 100644 --- a/src/Utils.js +++ b/src/Utils.js @@ -72,7 +72,12 @@ export default function Utils (Y) { } this.eventListeners[i](_event) } catch (e) { - console.error('Your observer threw an error. This error was caught so that Yjs still can ensure data consistency! In order to debug this error you have to check "Pause On Caught Exceptions"', e) + /* + Your observer threw an error. This error was caught so that Yjs + can ensure data consistency! In order to debug this error you + have to check "Pause On Caught Exceptions" in developer tools. + */ + console.error(e) } } }