From 83fd312c816332fb275dd097750e603406c0cb93 Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Thu, 27 Nov 2008 09:03:21 +0100 Subject: [PATCH] Added an exception when the scm command fails. This will help the debugging for people. --- src/IDF/Scm.php | 3 +++ src/IDF/Scm/Exception.php | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/IDF/Scm/Exception.php diff --git a/src/IDF/Scm.php b/src/IDF/Scm.php index 9e8de2d..8ee8c28 100644 --- a/src/IDF/Scm.php +++ b/src/IDF/Scm.php @@ -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; diff --git a/src/IDF/Scm/Exception.php b/src/IDF/Scm/Exception.php new file mode 100644 index 0000000..eae2fd6 --- /dev/null +++ b/src/IDF/Scm/Exception.php @@ -0,0 +1,26 @@ +