Skip to content

Commit

Permalink
Add build stack info support for NotFoundException
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Aug 30, 2021
1 parent 0f708cc commit 2b9ec7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Exception/NotFoundException.php
Expand Up @@ -14,10 +14,11 @@ final class NotFoundException extends Exception implements NotFoundExceptionInte
{
private string $id;

public function __construct(string $id)
public function __construct(string $id, array $buildStack = [])
{
$this->id = $id;
parent::__construct("No definition or class found for \"$id\".");
$buildStackMessage = $buildStack ? 'while building ' . implode(' -> ', $buildStack) : '';
parent::__construct(sprintf('No definition or class found for "%s"%s.', $id, $buildStackMessage));
}

public function getId(): string
Expand Down

0 comments on commit 2b9ec7b

Please sign in to comment.