Added error handling to publishing changes.

Change-Id: I2746fcce2545b96b33a1557353027e298ad824a8