Improved error reporting
This commit is contained in:
@ -40,6 +40,10 @@ class ApplyCommand extends Command
|
||||
$output->writeln("<error>Error: ".$e->getMessage()."</error>");
|
||||
return;
|
||||
}
|
||||
if (!$hotfix) {
|
||||
$output->writeln("<error>Could not load hotfix</error>");
|
||||
return;
|
||||
}
|
||||
|
||||
$output->writeln("");
|
||||
if (($signer = $hotfix->getSignedBy())) {
|
||||
|
@ -21,7 +21,9 @@ class Hotfix
|
||||
|
||||
protected function load($hotfix)
|
||||
{
|
||||
// echo $hotfix."\n\n";
|
||||
if (strpos($hotfix, "\n---\n")===false) {
|
||||
throw new \Exception("Hotfix is missing a proper header, is line endings wrong?");
|
||||
}
|
||||
list ($header, $body) = explode("\n---\n", $hotfix, 2);
|
||||
$header = Yaml::parse($header);
|
||||
|
||||
|
@ -43,7 +43,7 @@ class Loader
|
||||
}
|
||||
return new Hotfix($body, $signer);
|
||||
}
|
||||
fprintf(STDERR, "Error: Couldn't load '%s'", $fix);
|
||||
fprintf(STDERR, "Error: Couldn't load '%s'\n", $fix);
|
||||
}
|
||||
|
||||
protected function verifySignature($body, $signature)
|
||||
|
@ -6,6 +6,10 @@ class HttpLoader implements LoaderInterface
|
||||
{
|
||||
public function load($fix)
|
||||
{
|
||||
if (preg_match("/^http[s]?:/", $fix)) {
|
||||
$body = file_get_contents($fix);
|
||||
return $body;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user