Better error reporting on failed `build_cmd` run

When running the custom build command fails, this prints out a correct error
message, return code, stdout and stderr.