fedi-feed-router/app/Exceptions/PlatformAuthException.php

24 lines
486 B
PHP
Raw Normal View History

2025-06-30 18:18:30 +02:00
<?php
namespace App\Exceptions;
use App\Enums\PlatformEnum;
use Exception;
class PlatformAuthException extends Exception
{
public function __construct(
private readonly PlatformEnum $platform,
string $reason = 'Authentication failed'
) {
$message = "Failed to authenticate with {$platform->value}: {$reason}";
parent::__construct($message);
}
public function getPlatform(): PlatformEnum
{
return $this->platform;
}
}