Skip to content
Snippets Groups Projects

Issue #2886615 by scott_euser, clemens.tolboom, quietone, joachim, alexpott,...

Open Nitesh Sinha requested to merge issue/drupal-3186977:3186977-show-third-party into 9.3.x
1 file
+ 10
1
Compare changes
  • Side-by-side
  • Inline
@@ -71,7 +71,16 @@ public function fetchResource($url) {
]);
}
catch (TransferException $e) {
throw new ResourceException('Could not retrieve the oEmbed resource.', $url, [], $e);
$exception_message = 'Could not retrieve the oEmbed resource.';
$response = $e->getResponse();
if ($response) {
$body = $response->getBody();
$contents = json_decode($body->getContents(), TRUE);
if ($contents && is_array($contents['error']) && isset($contents['error']['message'])) {
$exception_message = $contents['error']['message'];
}
}
throw new ResourceException($exception_message, $url, [], $e);
}
[$format] = $response->getHeader('Content-Type');
Loading