diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index ec1e5c1a5..a18112c4b 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/src/Composer/EventDispatcher/EventDispatcher.php @@ -305,7 +305,11 @@ class EventDispatcher break; } } - } catch (\Exception $e) { + } catch (\Exception $e) { // TODO Composer 2.2 turn all this into a finally + $this->popEvent(); + + throw $e; + } catch (\Throwable $e) { $this->popEvent(); throw $e;