浏览代码

Display the error output in the thrown exception

Elendev 6 年之前
父节点
当前提交
ea5644281a
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/Composer/Util/Hg.php

+ 7 - 1
src/Composer/Util/Hg.php

@@ -63,9 +63,15 @@ class Hg
             if (0 === $this->process->execute($command)) {
                 return;
             }
+
+            $error = $this->process->getErrorOutput();
+        } else {
+            $error = 'The given URL (' . $url . ') does not match the required format (http(s)://(username:password@)example.com/path-to-repository)';
         }
 
-        $this->throwException('Failed to clone ' . $url . ', aborting', $url);
+
+
+        $this->throwException('Failed to clone ' . $url . ', ' . "\n\n" . $error, $url);
 
     }