That's not the Symfony way of doing this (it's the Doctrine way). Let's not mix those coding styles :)

The Symfony way will be to create a `DocumentNotSupported` exception like:
````php
class DocumentNotSupported extends SeoExtractorStrategyException
{
    public function __construct($document, $code = 0, \Exception $previous = null)
    {
        parent::__construct(
            sprintf(
                'The given document "%s" is not supported by this strategy, call the supports() method first.',
                is_object($document) ? get_class($document) : $document
            ),
            $code,
            $previous
        );
    }
}
````

And then use it as `throw new DocumentNotSupported($document);`.