Properties

$app

$app : \think\App

Type

App

$ignoreReport

$ignoreReport : array

不需要记录信息(日志)的异常类列表

Type

array

$isJson

$isJson

Methods

__construct()

__construct(\think\App  $app) : mixed

Parameters

\think\App $app

Returns

mixed —

report()

report(\Throwable  $exception) : void

记录异常信息(包括日志或者其它方式记录)

Parameters

\Throwable $exception

render()

render(\think\Request  $request, \Throwable  $e) : \think\Response

Render an exception into an HTTP response.

Parameters

\think\Request $request
\Throwable $e

Returns

\think\Response —

renderForConsole()

renderForConsole(\think\console\Output  $output, \Throwable  $e) : void

Parameters

\think\console\Output $output
\Throwable $e

isIgnoreReport()

isIgnoreReport(\Throwable  $exception) : bool

Parameters

\Throwable $exception

Returns

bool —

renderHttpException()

renderHttpException(\think\exception\HttpException  $e) : \think\Response

Parameters

\think\exception\HttpException $e

Returns

\think\Response —

convertExceptionToArray()

convertExceptionToArray(\Throwable  $exception) : array

收集异常数据

Parameters

\Throwable $exception

Returns

array —

convertExceptionToResponse()

convertExceptionToResponse(\Throwable  $exception) : \think\Response

Parameters

\Throwable $exception

Returns

\think\Response —

renderExceptionContent()

renderExceptionContent(\Throwable  $exception) : string

Parameters

\Throwable $exception

Returns

string —

getCode()

getCode(\Throwable  $exception) : int

获取错误编码 ErrorException则使用错误级别作为错误编码

Parameters

\Throwable $exception

Returns

int —

错误编码

getMessage()

getMessage(\Throwable  $exception) : string

获取错误信息 ErrorException则使用错误级别作为错误编码

Parameters

\Throwable $exception

Returns

string —

错误信息

getSourceCode()

getSourceCode(\Throwable  $exception) : array

获取出错文件内容 获取错误的前9行和后9行

Parameters

\Throwable $exception

Returns

array —

错误文件内容

getExtendData()

getExtendData(\Throwable  $exception) : array

获取异常扩展信息 用于非调试模式html返回类型显示

Parameters

\Throwable $exception

Returns

array —

异常类定义的扩展数据

getConst()

getConst() : array

获取常量列表

Returns

array —

常量列表