From 6886767f9a3dcd52b75e652355019396cce08af5 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Tue, 31 Mar 2026 20:45:41 -0300 Subject: [PATCH] feat: PublishToSocialPlatform catches SocialPublishException --- app/Jobs/PublishToSocialPlatform.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Jobs/PublishToSocialPlatform.php b/app/Jobs/PublishToSocialPlatform.php index 7b583d94..4d5f72f7 100644 --- a/app/Jobs/PublishToSocialPlatform.php +++ b/app/Jobs/PublishToSocialPlatform.php @@ -9,6 +9,7 @@ use App\Enums\PostPlatform\Status as PostPlatformStatus; use App\Enums\SocialAccount\Platform as SocialPlatform; use App\Events\PostPlatformStatusUpdated; +use App\Exceptions\Social\SocialPublishException; use App\Exceptions\TokenExpiredException; use App\Mail\PostPublished; use App\Mail\PostPublishFailed; @@ -82,6 +83,10 @@ public function handle(): void $this->postPlatform->markAsFailed($e->getMessage()); $this->postPlatform->socialAccount->markAsDisconnected($e->getMessage()); + } catch (SocialPublishException $e) { + Log::error('Social publish failed: '.$e->userMessage); + + $this->postPlatform->markAsFailed($e->userMessage); } catch (\Throwable $e) { Log::error('Failed to publish to social platform', [ 'post_platform_id' => $this->postPlatform->id,