From 2f0d20bbc81e2599db9360ebc7261a27214c2434 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Sat, 28 Jul 2018 15:09:15 -0700 Subject: [PATCH] Add logging to catch error Some users are seeing empty moving sets. Why? --- js/components/WindowManager.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/js/components/WindowManager.js b/js/components/WindowManager.js index 4ea4fa40..c2f9330f 100644 --- a/js/components/WindowManager.js +++ b/js/components/WindowManager.js @@ -132,7 +132,17 @@ class WindowManager extends React.Component { ) }; - const box = boundingBox(moving); + let box; + try { + box = boundingBox(moving); + } catch (err) { + console.error( + `Could not construct bounding box for key: ${key}. moving.length is: ${ + moving.length + }` + ); + throw err; + } const handleMouseMove = ee => { const proposedDiff = {