- Issue created by @AndersTwo
This particular exception happens when a YouTube video is no longer available or private, which is a very common situation.
The crash can be temporarily fixed in
ConvertUrlToEmbedFilter.php
as shown in the snippet below, although it's really only a first attempt at getting past the road block. Please excuse the misplaced use of a Bootstrap alert here. You certainly know a better way to inject a message to make end users aware of a problem with one of the URLs in the text.public function process($text, $langcode) { try { $result = new FilterProcessResult(static::convertUrls($text, $this->settings['url_prefix'])); } catch (NetworkException $e) { $result = new FilterProcessResult('<p class="alert alert-danger">A network exception occurred with embedding an URL</p> ' . $text); } return $result; }
- π¨π¦Canada dustin@pi
Hitting a similar issue, a "Could not resolve Host" is causing the WSOD:
Embed\Http\NetworkException: Could not resolve host: ..... in Embed\Http\CurlDispatcher->error() (line 165 of /app/vendor/embed/embed/src/Http/CurlDispatcher.php).
The error is coming from the same location in the underlying Embed library.
- πΊπΈUnited States mark_fullmer Tucson
I tested this on the 3.x branch and was unable to reproduce, using both a private YouTube video and a video that no longer exists. The report in #3 shows the expected line in embed/embed for version 4 of that library (which is the version that should be used), so I assume this *can* be reproduced with 3.0.0-beta1 of url_embed and v4.4.14 of embed/embed. Can someone provide more specific steps to reproduce?