mirror of
https://github.com/friendica/friendica
synced 2025-05-05 17:44:10 +02:00
Exceptions and warnings fixed
This commit is contained in:
parent
ac087749e3
commit
8cf82a8449
2 changed files with 7 additions and 2 deletions
|
@ -235,7 +235,12 @@ class ParseUrl
|
|||
return $siteinfo;
|
||||
}
|
||||
|
||||
$curlResult = DI::httpClient()->get($url, HttpClientAccept::HTML, [HttpClientOptions::CONTENT_LENGTH => 1000000]);
|
||||
try {
|
||||
$curlResult = DI::httpClient()->get($url, HttpClientAccept::HTML, [HttpClientOptions::CONTENT_LENGTH => 1000000]);
|
||||
} catch (\Throwable $th) {
|
||||
Logger::info('Exception when fetching', ['url' => $url, 'code' => $th->getCode(), 'message' => $th->getMessage()]);
|
||||
return $siteinfo;
|
||||
}
|
||||
if (!$curlResult->isSuccess() || empty($curlResult->getBodyString())) {
|
||||
Logger::info('Empty body or error when fetching', ['url' => $url, 'success' => $curlResult->isSuccess(), 'code' => $curlResult->getReturnCode()]);
|
||||
return $siteinfo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue