Skip to content

Commit

Permalink
Merge pull request #1147: Fix Stempler in Container Scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Sep 11, 2024
1 parent 1b72099 commit 45efa98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Request/InputManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Spiral\Core\Attribute\Scope;
use Spiral\Core\Attribute\Singleton;
use Spiral\Core\Exception\ScopeException;
use Spiral\Core\Internal\Introspector;
use Spiral\Http\Config\HttpConfig;
use Spiral\Http\Exception\InputException;
use Spiral\Http\Header\AcceptHeader;
Expand Down Expand Up @@ -192,10 +193,11 @@ public function request(): Request
try {
$request = $this->container->get(Request::class);
} catch (ContainerExceptionInterface $e) {
$scope = implode('.', \array_reverse(Introspector::scopeNames($this->container)));
throw new ScopeException(
'Unable to get `ServerRequestInterface` in active container scope',
"Unable to get `ServerRequestInterface` in the `$scope` container scope",
$e->getCode(),
$e
$e,
);
}

Expand Down

0 comments on commit 45efa98

Please sign in to comment.