1
0
Fork 0

Merge pull request #1617 from shanethehat/schema-validation-messages

Specific schema validation failure messages (fixes issue #1616)
pull/1609/merge
Jordi Boggiano 2013-02-25 09:22:28 -08:00
commit 663c47ba25
1 changed files with 6 additions and 0 deletions

View File

@ -24,6 +24,7 @@ use Composer\Composer;
use Composer\Factory; use Composer\Factory;
use Composer\IO\IOInterface; use Composer\IO\IOInterface;
use Composer\IO\ConsoleIO; use Composer\IO\ConsoleIO;
use Composer\Json\JsonValidationException;
use Composer\Util\ErrorHandler; use Composer\Util\ErrorHandler;
/** /**
@ -144,7 +145,12 @@ class Application extends BaseApplication
$this->io->write($e->getMessage()); $this->io->write($e->getMessage());
exit(1); exit(1);
} }
} catch (JsonValidationException $e) {
$errors = ' - ' . implode(PHP_EOL . ' - ', $e->getErrors());
$message = $e->getMessage() . ':' . PHP_EOL . $errors;
throw new JsonValidationException($message);
} }
} }
return $this->composer; return $this->composer;