| 包 | system.base |
|---|---|
| 继承 | class CHttpException » CException » Exception |
| 源自 | 1.0 |
| 版本 | $Id: CHttpException.PHP 2799 2011-01-01 19:31:13Z qiang.xue $ |
| 源码 |
CHttpException表示由最终用户非法操导致的异常。
HTTP错误码可通过statusCode获得。 错误处理程序可能过此状态码决定如何格式化错误页面。
HTTP错误码可通过statusCode获得。 错误处理程序可能过此状态码决定如何格式化错误页面。
公共属性
| 属性 | 类型 | 描述 | 定义在 |
|---|---|---|---|
| statusCode | integer | HTTP状态码,如403,404,500等等。 | CHttpException |
受保护属性
| 属性 | 类型 | 描述 | 定义在 |
|---|---|---|---|
| code | Exception | ||
| file | Exception | ||
| line | Exception | ||
| message | Exception |
公共方法
| 方法 | 描述 | 定义在 |
|---|---|---|
| __construct() | 构造器。 | CHttpException |
| __toString() | Exception | |
| getCode() | Exception | |
| getFile() | Exception | |
| getLine() | Exception | |
| getMessage() | Exception | |
| getPrevious() | Exception | |
| getTrace() | Exception | |
| getTraceAsString() | Exception |
属性详细
statusCode
属性
public integer $statusCode;
HTTP状态码,如403,404,500等等。
方法详细
__construct()
方法
|
public void __construct(integer $status, string $message=NULL, integer $code=0)
| ||
| $status | integer | HTTP状态码,如403,404,500等等。 |
| $message | string | 错误信息 |
| $code | integer | 错误代码 |
public function __construct($status,$message=null,$code=0)
{
$this->statusCode=$status;
parent::__construct($message,$code);
}
构造器。