I would like to alert my users when something goes wrong, and also do some reporting to our backend. Is there a recommended way to do this?
I have been using this:
dispatchTransaction(transaction) {
try {
const newState = view.state.apply(transaction);
view.updateState(newState);
} catch (error) {
alert('Sorry, your last action failed. Please try again.');
handleError(error);
}
}
It works, but I am wondering if there is a better way to handle it?
Thanks!