Catch all errors thrown by "fetchRaw"

This commit is contained in:
Michael 2023-02-26 14:08:33 +00:00
parent 6870ccc00e
commit 2b513a48c7
8 changed files with 64 additions and 28 deletions

View file

@ -422,7 +422,12 @@ class HTTPSignature
*/
public static function fetch(string $request, int $uid): array
{
$curlResult = self::fetchRaw($request, $uid);
try {
$curlResult = self::fetchRaw($request, $uid);
} catch (\Throwable $th) {
Logger::notice('Error fetching url', ['url' => $request, 'error' => $th]);
return [];
}
if (empty($curlResult)) {
return [];