diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 7a298756e876..d60a3bb86ae7 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -419,7 +419,8 @@ public function getComposer($required = true, $disablePlugins = null) } 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;