mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-09 05:08:17 +08:00
65 lines
1.7 KiB
PHP
65 lines
1.7 KiB
PHP
<?php
|
||
|
||
// +----------------------------------------------------------------------
|
||
// | Library for ThinkAdmin
|
||
// +----------------------------------------------------------------------
|
||
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
|
||
// +----------------------------------------------------------------------
|
||
// | 官方网站: https://thinkadmin.top
|
||
// +----------------------------------------------------------------------
|
||
// | 开源协议 ( https://mit-license.org )
|
||
// | 免费声明 ( https://thinkadmin.top/disclaimer )
|
||
// +----------------------------------------------------------------------
|
||
// | gitee 仓库地址 :https://gitee.com/zoujingli/ThinkLibrary
|
||
// | github 仓库地址 :https://github.com/zoujingli/ThinkLibrary
|
||
// +----------------------------------------------------------------------
|
||
|
||
declare (strict_types=1);
|
||
|
||
namespace think\admin;
|
||
|
||
/**
|
||
* 自定义数据异常
|
||
* @class Exception
|
||
* @package think\admin
|
||
*/
|
||
class Exception extends \Exception
|
||
{
|
||
/**
|
||
* 异常数据对象
|
||
* @var mixed
|
||
*/
|
||
protected $data = [];
|
||
|
||
/**
|
||
* Exception constructor.
|
||
* @param string $message
|
||
* @param integer $code
|
||
* @param mixed $data
|
||
*/
|
||
public function __construct($message = "", $code = 0, $data = [])
|
||
{
|
||
parent::__construct($message);
|
||
$this->code = $code;
|
||
$this->data = $data;
|
||
$this->message = $message;
|
||
}
|
||
|
||
/**
|
||
* 获取异常停止数据
|
||
* @return mixed
|
||
*/
|
||
public function getData()
|
||
{
|
||
return $this->data;
|
||
}
|
||
|
||
/**
|
||
* 设置异常停止数据
|
||
* @param mixed $data
|
||
*/
|
||
public function setData($data)
|
||
{
|
||
$this->data = $data;
|
||
}
|
||
} |