Matthieu Moquet пре 12 година
родитељ
комит
3b22791059

+ 7 - 6
src/Composer/Package/Archiver/BaseArchiver.php

@@ -34,12 +34,13 @@ abstract class BaseArchiver implements ArchiverInterface
             $phar = new \PharData($target, null, null, $format);
             $phar->buildFromDirectory($sources);
         } catch (\UnexpectedValueException $e) {
-            throw new \RuntimeException(
-                sprintf("Could not create archive '%s' from '%s': %s",
-                    $target,
-                    $sources,
-                    $e->getMessage()
-                ));
+            $message = sprintf("Could not create archive '%s' from '%s': %s",
+                $target,
+                $sources,
+                $e->getMessage()
+            );
+
+            throw new \RuntimeException($message, $e->getCode(), $e);
         }
     }
 }

+ 7 - 1
src/Composer/Package/Archiver/GitArchiver.php

@@ -33,7 +33,13 @@ class GitArchiver extends VcsArchiver
             $sourceRef
         );
 
-        $this->process->execute($command, $output, $source);
+        $exitCode = $this->process->execute($command, $output, $source);
+
+        if (0 !== $exitCode) {
+            throw new \RuntimeException(
+                sprintf('The command `%s` returned %s', $command, $exitCode)
+            );
+        }
     }
 
     /**

+ 7 - 1
src/Composer/Package/Archiver/MercurialArchiver.php

@@ -33,7 +33,13 @@ class MercurialArchiver extends VcsArchiver
             escapeshellarg($target)
         );
 
-        $this->process->execute($command, $output, $source);
+        $exitCode = $this->process->execute($command, $output, $source);
+
+        if (0 !== $exitCode) {
+            throw new \RuntimeException(
+                sprintf('The command `%s` returned %s', $command, $exitCode)
+            );
+        }
     }
 
     /**