Create snapshot only after errors

Change-Id: I893ecabaa5ca6076a7afb171d3728edee7cfbe2a
Related-Bug: #1323147