| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | namespace Nexus\Mcp\Client\Exception; |
| 15: | |
| 16: | use Nexus\Mcp\Core\Exception\McpExceptionInterface; |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | final class InsufficientScopeException extends \RuntimeException implements McpExceptionInterface |
| 25: | { |
| 26: | |
| 27: | |
| 28: | |
| 29: | public function __construct(public readonly array $required) |
| 30: | { |
| 31: | parent::__construct([] === $required |
| 32: | ? 'The MCP server requires a scope the token does not carry, and named none.' |
| 33: | : \sprintf('The MCP server requires the scope "%s", which the token does not carry.', implode(' ', $required))); |
| 34: | } |
| 35: | } |
| 36: | |