3 namespace Drupal\media\OEmbed;
6 * Exception thrown if an oEmbed resource cannot be fetched or parsed.
9 * This is an internal part of the oEmbed system and should only be used by
10 * oEmbed-related code in Drupal core.
12 class ResourceException extends \Exception {
15 * The URL of the resource.
29 * ResourceException constructor.
31 * @param string $message
32 * The exception message.
34 * The URL of the resource. Can be the actual endpoint URL or the canonical
37 * (optional) The raw resource data, if available.
38 * @param \Exception $previous
39 * (optional) The previous exception, if any.
41 public function __construct($message, $url, array $data = [], \Exception $previous = NULL) {
44 parent::__construct($message, 0, $previous);
48 * Gets the URL of the resource which caused the exception.
51 * The URL of the resource.
53 public function getUrl() {
58 * Gets the raw resource data, if available.
63 public function getData() {