diff --git a/src/Http/FakeHttp.php b/src/Http/FakeHttp.php index d11b6c3..2c20cd6 100644 --- a/src/Http/FakeHttp.php +++ b/src/Http/FakeHttp.php @@ -447,8 +447,10 @@ public function handleRequest(ServerRequestInterface $request, array $bindings = try { return new TestResponse(($this->scope)($handler, $bindings)); } finally { - if ($this->container->has(FinalizerInterface::class)) { + try { $this->container->get(FinalizerInterface::class)->finalize(false); + } catch (\Throwable) { + // Ignore exceptions when finalizer is out of scope } } }