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 13f972e..a757b07 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);
     }