mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-23 11:23:41 +00:00
catch exception during http request
This commit is contained in:
parent
2ce14fb2ff
commit
9832fa6c45
1 changed files with 6 additions and 1 deletions
|
@ -214,7 +214,12 @@ function mailstream_do_images(array &$item, array &$attachments)
|
|||
}
|
||||
|
||||
$cookiejar = tempnam(System::getTempPath(), 'cookiejar-mailstream-');
|
||||
try {
|
||||
$curlResult = DI::httpClient()->fetchFull($url, HttpClientAccept::DEFAULT, 0, $cookiejar);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
Logger::error('mailstream_do_images exception fetching url', ['url' => $url, 'item_id' => $item['id']]);
|
||||
continue;
|
||||
}
|
||||
$attachments[$url] = [
|
||||
'data' => $curlResult->getBody(),
|
||||
'guid' => hash('crc32', $url),
|
||||
|
|
Loading…
Reference in a new issue