feat: PublishToSocialPlatform catches SocialPublishException
This commit is contained in:
parent
92ef7428b1
commit
6886767f9a
1 changed files with 5 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue