Added an exception when the scm command fails.

This will help the debugging for people.
This commit is contained in:
Loic d'Anterroches
2008-11-27 09:03:21 +01:00
parent f9b6a022c8
commit 83fd312c81
2 changed files with 29 additions and 0 deletions

View File

@@ -55,6 +55,9 @@ class IDF_Scm
$cache = Pluf_Cache::factory();
if (null === ($res=$cache->get($key))) {
$ll = exec($command, $output, $return);
if ($return != 0) {
throw new IDF_Scm_Exception(sprintf('Error when running command: "%s", return code: %d', $command, $return));
}
$cache->set($key, array($ll, $return, $output));
} else {
list($ll, $return, $output) = $res;