Add command output to raised exception if the result code is nonzero.