Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff8c5ca

Browse files
committed
Unset loading[$id] in ContainerBuilder on exception
1 parent e047ac8 commit ff8c5ca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,12 @@ public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INV
431431

432432
$this->loading[$id] = true;
433433

434-
$service = $this->createService($definition, $id);
434+
try {
435+
$service = $this->createService($definition, $id);
436+
} catch (\Exception $e) {
437+
unset($this->loading[$id]);
438+
throw $e;
439+
}
435440

436441
unset($this->loading[$id]);
437442

0 commit comments

Comments
 (0)