raise exception if a process ends with non-zero exit status