Exit code handling

feature/node-rewrite
Sven Slootweg 13 years ago
parent 03a518814a
commit 5f220a7478

@ -103,6 +103,11 @@ class SshConnector extends CPHPBaseClass
fclose($stream); fclose($stream);
if($returndata->returncode != 0 && $throw_exception === true)
{
throw new SshExitException("Non-zero exit code returned: {$returndata->stderr}", $returndata->returncode);
}
return $returndata; return $returndata;
} }
} }

@ -13,7 +13,7 @@ pr.wait()
obj = { obj = {
'stdout': data[0], 'stdout': data[0],
'stderr': data[1], 'stderr': data[1],
'return': pr.returncode 'returncode': pr.returncode
} }
print json.dumps(obj) print json.dumps(obj)

Loading…
Cancel
Save