diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index a87f40f8c..48d617307 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -419,7 +419,10 @@ class Application extends BaseApplication } catch (\InvalidArgumentException $e) { if ($required) { $this->io->writeError($e->getMessage()); - exit(1); + if ($this->areExceptionsCaught()){ + exit(1); + } + throw $e; } } catch (JsonValidationException $e) { if ($required) {