Throw proper error stack when observer function thrown an error - implements #75

This commit is contained in:
Kevin Jahns 2017-07-05 11:37:22 +02:00
parent a6a321da10
commit 85e488bbe6
2 changed files with 7 additions and 2 deletions

View File

@ -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",

View File

@ -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)
}
}
}