return error on failure
respect errors from subprocesses
simplify quit condition
check for failure