Actorの取得失敗をちゃんと無視するように
This commit is contained in:
parent
1ba4999a83
commit
3584625b47
@ -3,6 +3,8 @@
|
||||
namespace App\MetadataResolver;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use GuzzleHttp\Exception\TransferException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ActivityPubResolver implements Resolver, Parser
|
||||
{
|
||||
@ -46,8 +48,10 @@ class ActivityPubResolver implements Resolver, Parser
|
||||
|
||||
private function getTitleFromActor(string $url): string
|
||||
{
|
||||
try {
|
||||
$res = $this->activityClient->get($url);
|
||||
if ($res->getStatusCode() !== 200) {
|
||||
Log::info(self::class . ': Actorの取得に失敗 URL=' . $url);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -58,6 +62,10 @@ class ActivityPubResolver implements Resolver, Parser
|
||||
}
|
||||
|
||||
return $title;
|
||||
} catch (TransferException $e) {
|
||||
Log::info(self::class . ': Actorの取得に失敗 URL=' . $url);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
private function html2text(string $html): string
|
||||
|
Loading…
Reference in New Issue
Block a user