Files
lotteryLaravel/app/Exceptions/PlayerAuthenticationException.php

24 lines
621 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Exceptions;
use RuntimeException;
use App\Lottery\ErrorCode;
/**
* 玩家端 Bearer 鉴权失败时抛出,由 EnsurePlayerApi 捕获并转为 JSON。
*
* @property-read int $lotteryCode 业务错误码({@see ErrorCode}
* @property-read int $httpStatus HTTP 状态码401 未授权、503 服务未配置等)
*/
final class PlayerAuthenticationException extends RuntimeException
{
public function __construct(
string $message,
public readonly int $lotteryCode,
public readonly int $httpStatus = 401,
) {
parent::__construct($message);
}
}