try {
$fetchResult = HTTPSignature::fetchRaw($avatar, 0, [HttpClientOptions::ACCEPT_CONTENT => [HttpClientAccept::IMAGE]]);
- } catch (\Throwable $th) {
- Logger::notice('Avatar is invalid', ['avatar' => $avatar, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::notice('Avatar is invalid', ['avatar' => $avatar, 'exception' => $exception]);
return $fields;
}
if ($Notification->targetUriId) {
try {
$status = $this->mstdnStatusFactory->createFromUriId($Notification->targetUriId, $Notification->uid, $display_quotes);
- } catch (\Throwable $th) {
+ } catch (\Exception $exception) {
$status = null;
}
} else {
if ($is_reshare) {
try {
$reshare = $this->createFromUriId($uriId, $uid, $display_quote, false, false)->toArray();
- } catch (\Throwable $th) {
- Logger::info('Reshare not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Reshare not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'exception' => $exception]);
$reshare = [];
}
} else {
if ($in_reply_status && ($item['gravity'] == Item::GRAVITY_COMMENT)) {
try {
$in_reply = $this->createFromUriId($item['thr-parent-id'], $uid, $display_quote, false, false)->toArray();
- } catch (\Throwable $th) {
- Logger::info('Reply post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Reply post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'exception' => $exception]);
$in_reply = [];
}
} else {
if (!empty($quote_id)) {
try {
$quote = $this->createFromUriId($quote_id, $uid, false, false, false)->toArray();
- } catch (\Throwable $th) {
- Logger::info('Quote not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Quote not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'exception' => $exception]);
$quote = [];
}
} else {
if (!$failed && ($curlResult->getReturnCode() == 410)) {
$data = ['@context' => ActivityPub::CONTEXT, 'id' => $url, 'type' => 'Tombstone'];
}
- } catch (\Throwable $th) {
- Logger::notice('Error fetching url', ['url' => $url, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::notice('Error fetching url', ['url' => $url, 'exception' => $exception]);
$failed = true;
}
return;
}
}
- } catch (\Throwable $th) {
- Logger::notice('Error fetching avatar', ['avatar' => $avatar, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::notice('Error fetching avatar', ['avatar' => $avatar, 'exception' => $exception]);
return;
}
} elseif (!empty($contact['blurhash'])) {
if (empty($curlResult) || !$curlResult->isSuccess()) {
return [];
}
- } catch (\Throwable $th) {
- Logger::notice('Error fetching url', ['url' => $url, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::notice('Error fetching url', ['url' => $url, 'exception' => $exception]);
return [];
}
$fields = ['mimetype' => $curlResult->getHeader('Content-Type')[0]];
self::setBoundaries($item['uri-id']);
try {
$statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
- } catch (\Throwable $th) {
- Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'exception' => $exception]);
}
}
DBA::close($items);
self::setBoundaries($item['uri-id']);
try {
$statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
- } catch (\Throwable $th) {
- Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'exception' => $exception]);
}
}
DBA::close($items);
self::setBoundaries($item['thr-parent-id']);
try {
$statuses[] = DI::mstdnStatus()->createFromUriId($item['thr-parent-id'], $uid, $display_quotes);
- } catch (\Throwable $th) {
- Logger::info('Post not fetchable', ['uri-id' => $item['thr-parent-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['thr-parent-id'], 'uid' => $uid, 'exception' => $exception]);
}
}
DBA::close($items);
self::setBoundaries($member['contact-id']);
try {
$accounts[] = DI::mstdnAccount()->createFromContactId($member['contact-id'], $uid);
- } catch (\Throwable $th) {
+ } catch (\Exception $exception) {
}
}
DBA::close($members);
self::setBoundaries($item['uri-id']);
try {
$statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
- } catch (\Throwable $th) {
- Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'exception' => $exception]);
}
}
DBA::close($items);
self::setBoundaries($item['uri-id']);
try {
$statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
- } catch (\Throwable $th) {
- Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'exception' => $exception]);
}
}
DBA::close($items);
self::setBoundaries($item['uri-id']);
try {
$statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
- } catch (\Throwable $th) {
- Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'exception' => $exception]);
}
}
DBA::close($items);
self::setBoundaries($item['uri-id']);
try {
$statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
- } catch (\Throwable $th) {
- Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'exception' => $exception]);
}
}
DBA::close($items);
self::setBoundaries($item['uri-id']);
try {
$statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
- } catch (\Throwable $th) {
- Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'exception' => $exception]);
}
}
DBA::close($items);
while ($status = Post::fetch($statuses)) {
try {
$trending[] = DI::mstdnStatus()->createFromUriId($status['uri-id'], $uid, $display_quotes);
- } catch (\Throwable $th) {
- Logger::info('Post not fetchable', ['uri-id' => $status['uri-id'], 'uid' => $uid, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::info('Post not fetchable', ['uri-id' => $status['uri-id'], 'uid' => $uid, 'exception' => $exception]);
}
}
DBA::close($statuses);
self::responseError();
// stop.
}
- } catch (\Throwable $th) {
- Logger::notice('Error fetching image', ['image' => $request['url'], 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::notice('Error fetching image', ['image' => $request['url'], 'exception' => $exception]);
self::responseError();
}
if ($image->isImagick()) {
try {
$colors = $image->image->getImagePixelColor($x, $y)->getColor();
- } catch (\Throwable $th) {
+ } catch (\Exception $exception) {
return '';
}
$row[] = [$colors['r'], $colors['g'], $colors['b']];
{
try {
$curlResult = HTTPSignature::fetchRaw($url, 0);
- } catch (\Throwable $th) {
- Logger::notice('Error fetching url', ['url' => $url, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::notice('Error fetching url', ['url' => $url, 'exception' => $exception]);
return true;
}
{
try {
$curlResult = self::fetchRaw($request, $uid);
- } catch (\Throwable $th) {
- Logger::notice('Error fetching url', ['url' => $request, 'error' => $th]);
+ } catch (\Exception $exception) {
+ Logger::notice('Error fetching url', ['url' => $request, 'exception' => $exception]);
return [];
}