Perform manual error checks instead of set -e

When using set -e, if you have a command fail, even when setting a
variable, it causes the node to fail. I have removed set -e and checked
error state where unexpected everywhere. I also added additional
logging.

Closes-Bug: #1326326
Change-Id: I7d2568c3693b9c486672e4322c7f01622aeba875
Merge "Perform manual error checks instead of set -e"