Work around cutycapt wait-timeout exit code bug
authorChristian Weiske <cweiske@cweiske.de>
Fri, 8 Jul 2016 15:11:45 +0000 (17:11 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 8 Jul 2016 15:11:45 +0000 (17:11 +0200)
src/phancap/Adapter/Cutycapt.php

index 13f972e22c8c3511d7a780f06cd131ae71acc536..a757b07929d1d3def39b5c9913146c141370a929 100644 (file)
@@ -117,6 +117,11 @@ class Adapter_Cutycapt
         // we kill it if it does not exit itself
         Executor::runForSomeTime($xvfbcmd . ' ' . $cmd, $maxWaitTime);
 
+        //cutycapt does not report timeouts via exit status
+        if (!file_exists($tmpPath)) {
+            throw new \Exception('Error running cutycapt (wait timeout)', 1);
+        }
+
         $this->resize($tmpPath, $img, $options);
     }