The TweetFetcher service is used to retrieve tweet information from Twitter's API. It offloads the heavy work to the j7mbo/twitter-api-php PHP library. That library throws a standard Exception when something goes wrong, but this module doesn't catch that exception to log it or anything. It just lets it bubble up.

In the context that we're calling this API (from the getField() method on Twitter media entity type class), we should catch any exception like that, log it, and return FALSE.

Comments

bkosborne created an issue.

bgilhome’s picture

As far as I can tell the vendor package uses cURL to make the request, which doesn't throw exceptions as far as I know? And this module checks curl_error() and throws an exception if non-empty. I think that should be sufficient, but of course it wouldn't hurt wrapping the TweetFetcher::fetchTweet() code in a try/catch.