[statusnet] Catch TransferExceptions for HTTPClient::finalUrl() #1163

Merged
nupplaphil merged 2 commits from bug/http_client into 2021.09-rc 2021-08-29 14:41:00 +02:00
Showing only changes of commit c06fff6921 - Show all commits

View file

@ -1430,8 +1430,8 @@ function statusnet_convertmsg(App $a, $body)
try {
$expanded_url = DI::httpClient()->finalUrl($match[1]);
} catch (TransferException $exception) {
Logger::notice('statusnet_convertmsg: Couldn\'t get final URL.', ['url' => $match[2], 'exception' => $exception]);
$expanded_url = $match[2];
Logger::notice('statusnet_convertmsg: Couldn\'t get final URL.', ['url' => $match[1], 'exception' => $exception]);
$expanded_url = $match[1];
}
Logger::log("statusnet_convertmsg: fetching data for " . $expanded_url, Logger::DEBUG);