diff --git a/frontend/classes/class.sshconnector.php b/frontend/classes/class.sshconnector.php index 8d587bc..da38445 100644 --- a/frontend/classes/class.sshconnector.php +++ b/frontend/classes/class.sshconnector.php @@ -103,6 +103,11 @@ class SshConnector extends CPHPBaseClass fclose($stream); + if($returndata->returncode != 0 && $throw_exception === true) + { + throw new SshExitException("Non-zero exit code returned: {$returndata->stderr}", $returndata->returncode); + } + return $returndata; } } diff --git a/runhelper/runhelper b/runhelper/runhelper index ba3b1cc..8a78b19 100644 --- a/runhelper/runhelper +++ b/runhelper/runhelper @@ -13,7 +13,7 @@ pr.wait() obj = { 'stdout': data[0], 'stderr': data[1], - 'return': pr.returncode + 'returncode': pr.returncode } print json.dumps(obj)