mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 15:57:50 +08:00
34 lines
646 B
PHP
34 lines
646 B
PHP
<?php
|
|
|
|
namespace App\Exception;
|
|
|
|
use App\Constants\ResultCode;
|
|
use Hyperf\Server\Exception\ServerException;
|
|
use Throwable;
|
|
|
|
class ErrException extends ServerException
|
|
{
|
|
/**
|
|
* @var int
|
|
*/
|
|
protected $code = ResultCode::ERROR;
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected array $data = [];
|
|
|
|
public function __construct(string $message = 'failed', int $code = 0, array $data = [], ?Throwable $previous = null)
|
|
{
|
|
parent::__construct($message, $code, $previous);
|
|
$this->data = $data;
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getData(): array
|
|
{
|
|
return $this->data;
|
|
}
|
|
} |