Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ProviderException.php

class ProviderException

Exception thrown if an oEmbed provider causes an error.

@internal This is an internal part of the oEmbed system and should only be used by oEmbed-related code in Drupal core.

Hierarchy

  • class \Drupal\media\OEmbed\ProviderException extends \Drupal\media\OEmbed\Exception

Expanded class hierarchy of ProviderException

1 file declares its use of ProviderException
OEmbedResourceConstraintValidator.php in core/modules/media/src/Plugin/Validation/Constraint/OEmbedResourceConstraintValidator.php

File

core/modules/media/src/OEmbed/ProviderException.php, line 12

Namespace

Drupal\media\OEmbed
View source
class ProviderException extends \Exception {
    
    /**
     * Information about the oEmbed provider which caused the exception.
     *
     * @var \Drupal\media\OEmbed\Provider
     *
     * @see \Drupal\media\OEmbed\ProviderRepositoryInterface::get()
     */
    protected $provider;
    
    /**
     * ProviderException constructor.
     *
     * @param string $message
     *   The exception message. '@name' will be replaced with the provider name
     *   if available, or '<unknown>' if not.
     * @param \Drupal\media\OEmbed\Provider $provider
     *   (optional) The provider information.
     * @param \Exception $previous
     *   (optional) The previous exception, if any.
     */
    public function __construct($message, ?Provider $provider = NULL, ?\Exception $previous = NULL) {
        $this->provider = $provider;
        $message = str_replace('@name', $provider ? $provider->getName() : '<unknown>', $message);
        parent::__construct($message, 0, $previous);
    }

}

Members

Title Sort descending Modifiers Object type Summary
ProviderException::$provider protected property Information about the oEmbed provider which caused the exception.
ProviderException::__construct public function ProviderException constructor.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal