1
0
Fork 0

Merge pull request #400 from kostiklv/descriptive-exception

More descriptive exceptions wording
pull/404/head
Jordi Boggiano 2012-03-07 00:45:03 -08:00
commit 91411a3dd4
4 changed files with 5 additions and 5 deletions

View File

@ -35,9 +35,9 @@ class Compiler
unlink($pharFile); unlink($pharFile);
} }
$process = new Process('git log --pretty="%h" -n1 HEAD'); $process = new Process('git log --pretty="%h" -n1 HEAD', __DIR__);
if ($process->run() != 0) { if ($process->run() != 0) {
throw new \RuntimeException('The git binary cannot be found.'); throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.');
} }
$this->version = trim($process->getOutput()); $this->version = trim($process->getOutput());

View File

@ -74,7 +74,7 @@ class GitDownloader extends VcsDownloader
} }
if (trim($output)) { if (trim($output)) {
throw new \RuntimeException('Source directory has uncommitted changes'); throw new \RuntimeException('Source directory ' . $path . ' has uncommitted changes');
} }
} }
} }

View File

@ -50,7 +50,7 @@ class HgDownloader extends VcsDownloader
{ {
$this->process->execute(sprintf('cd %s && hg st', escapeshellarg($path)), $output); $this->process->execute(sprintf('cd %s && hg st', escapeshellarg($path)), $output);
if (trim($output)) { if (trim($output)) {
throw new \RuntimeException('Source directory has uncommitted changes'); throw new \RuntimeException('Source directory ' . $path . ' has uncommitted changes');
} }
} }
} }

View File

@ -51,7 +51,7 @@ class SvnDownloader extends VcsDownloader
{ {
$this->process->execute(sprintf('cd %s && svn status', escapeshellarg($path)), $output); $this->process->execute(sprintf('cd %s && svn status', escapeshellarg($path)), $output);
if (trim($output)) { if (trim($output)) {
throw new \RuntimeException('Source directory has uncommitted changes'); throw new \RuntimeException('Source directory ' . $path . ' has uncommitted changes');
} }
} }
} }