print errors before halting

Hi,

Some steps were able to halt the build without printing the reason.
This PR fix this.

Cheers