Catching errors on rebuilding

Change-Id: Ic90c7cacfe51148547be4f9fddedae3b82c279b1
Merge "Catching errors on rebuilding"