diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 7a298756e..d60a3bb86 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -419,7 +419,8 @@ class Application extends BaseApplication } catch (\InvalidArgumentException $e) { if ($required) { $this->io->writeError($e->getMessage()); - if ($this->catchExceptions) { + // TODO composer 2.3 simplify to $this->areExceptionsCaught() + if (!method_exists($this, 'areExceptionsCaught') || $this->areExceptionsCaught()) { exit(1); } throw $e;