Create snapshot only after errors

Change-Id: Ic42f07df54dcec60d88e86730b3e8a0bef4946a2