Capture exceptions in js and send update to server only with exceptions