\Framework\Core\ExceptionHandler

Summary

Methods
Properties
Constants
__construct()
report()
render()
No public properties found
No constants found
No protected methods found
$debug
N/A
getCodeSnippet()
$requestId
N/A

Properties

$debug

$debug : bool

Type

bool

$requestId

$requestId : string

Type

string

Methods

__construct()

__construct(\Framework\Config\ConfigService  $config) : mixed

Parameters

\Framework\Config\ConfigService $config

Returns

mixed —

report()

report(\Throwable  $e) : void

报告异常:记录日志.

Parameters

\Throwable $e

render()

render(\Throwable  $e) : void

渲染异常:友好错误,输出给用户.

Parameters

\Throwable $e

getCodeSnippet()

getCodeSnippet(string  $filePath, int  $errorLine, int  $context = 5) : string

获取错误行附近的代码片段(带行号和高亮).

Parameters

string $filePath
int $errorLine
int $context

Returns

string —