Custom handler for js errors with backend to store them