异常{}

在本文中

HTTP请求例外

方法

姓名描述
异常::__construct创建新异常
异常::getData提供任何相关数据
异常::getType喜欢\异常::getCode(),但为字符串代码。

来源

类异常扩展了PHPException{/***异常的类型**@var字符串*/受保护的$type;/***与异常关联的数据**@var混合*/受保护的$data;/***创建新异常**@param string$message异常消息*@param string$type异常类型*@param混合$data关联数据*@param integer$code例外数字代码,如果适用*/公共函数__construct($message,$type,$data=null,$code=0){父级::__construct($message,$code);$this->type=$type;$this->data=$data;}/***喜欢\异常::getCode(),但为字符串代码。**@codeCoverage忽略*@return字符串*/公共函数getType(){返回$this->类型;}/***提供任何相关数据**@codeCoverage忽略*@返回混合*/公共函数getData(){返回$this->数据;}}

用户贡献的笔记

你必须登录在能够发表注释或反馈之前。