23 lines
486 B
PHP
23 lines
486 B
PHP
<?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;
|
|
}
|
|
}
|