capture errors as they occur and trap on them

Change-Id: I7eea1a93b5fb4093ada25799b87267727447ee74