fix uncaught errors inside promise when an Office.EventType.BindingDataChanged event re-triggers itself (Office.js)
When a user changes a bound cell, it triggers an Office.EventType.BindingDataChanged event and a callback associated with it. In the Excel Online browser-based client and not the desktop Excel client, if the callback function makes further changes to the bound cell e.g. changing its color based on input value (*), this produces uncaught errors after ctx.sync is called.
These errors surface outside my functions after they return control to the browser (chrome in this case), so I am ignoring them at the moment and hope they have no ill effects but thought you'd like to know.
I originally mitigated this by removing and re-adding the change event listeners, but this is way too slow due to the calls back and forth to Microsoft, so the new mitigation has been to add the binding id to a list whenever programmatic changes are made to a cell and have the callback query the list (using eventArgs.binding.id) to decide whether or not to eat the event. It's not ideal but it's a lot faster than the asynchronous calls to office.js.
(*) Also, if the user begins to enter a value into an empty bound cell then deletes it using backspace and presses enter, this causes the error even if the callback function doesn't change the contents of the cell (!?)