Skip to content

Commit

Permalink
Input Manager: print scope names if ServerRequestInterface is not set…
Browse files Browse the repository at this point in the history
… in the current scope
  • Loading branch information
roxblnfk committed Sep 11, 2024
1 parent 469db71 commit 3c889dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Http/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 3c889dd

Please sign in to comment.