PHP Class think\exception\Handle

显示文件 Open project: top-think/framework Class Usage Examples

Protected Properties

Property Type Description
$ignoreReport

Public Methods

Method Description
render ( Exception $e ) : Response Render an exception into an HTTP response.
renderForConsole ( Output $output, Exception $e )
report ( Exception $exception ) : void Report or log an exception.

Protected Methods

Method Description
convertExceptionToResponse ( Exception $exception ) : Response
getCode ( Exception $exception ) : integer 获取错误编码 ErrorException则使用错误级别作为错误编码
getExtendData ( Exception $exception ) : array 获取异常扩展信息 用于非调试模式html返回类型显示
getMessage ( Exception $exception ) : string 获取错误信息 ErrorException则使用错误级别作为错误编码
getSourceCode ( Exception $exception ) : array 获取出错文件内容 获取错误的前9行和后9行
isIgnoreReport ( Exception $exception )
renderHttpException ( HttpException $e ) : Response

Private Methods

Method Description
getConst ( ) : array 获取常量列表

Method Details

convertExceptionToResponse() protected method

protected convertExceptionToResponse ( Exception $exception ) : Response
$exception Exception
return think\Response

getCode() protected method

获取错误编码 ErrorException则使用错误级别作为错误编码
protected getCode ( Exception $exception ) : integer
$exception Exception
return integer 错误编码

getExtendData() protected method

获取异常扩展信息 用于非调试模式html返回类型显示
protected getExtendData ( Exception $exception ) : array
$exception Exception
return array 异常类定义的扩展数据

getMessage() protected method

获取错误信息 ErrorException则使用错误级别作为错误编码
protected getMessage ( Exception $exception ) : string
$exception Exception
return string 错误信息

getSourceCode() protected method

获取出错文件内容 获取错误的前9行和后9行
protected getSourceCode ( Exception $exception ) : array
$exception Exception
return array 错误文件内容

isIgnoreReport() protected method

protected isIgnoreReport ( Exception $exception )
$exception Exception

render() public method

Render an exception into an HTTP response.
public render ( Exception $e ) : Response
$e Exception
return think\Response

renderForConsole() public method

public renderForConsole ( Output $output, Exception $e )
$output think\console\Output
$e Exception

renderHttpException() protected method

protected renderHttpException ( HttpException $e ) : Response
$e HttpException
return think\Response

report() public method

Report or log an exception.
public report ( Exception $exception ) : void
$exception Exception
return void

Property Details

$ignoreReport protected_oe property

protected $ignoreReport