mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-07 12:38:11 +08:00
fix(think-library): trace_file 参数类型改为 Throwable 以兼容 PHP Error
- 将 trace_file() 参数类型由 Exception 改为 \Throwable - 解决 Library::load() 等处捕获 Error 时传入 trace_file 触发的 TypeError - PHP 7+ 中 Error 与 Exception 均实现 Throwable,可统一记录到 trace 文件 Made-with: Cursor
This commit is contained in:
parent
d5e9524a89
commit
c6c3184f73
@ -415,8 +415,9 @@ if (!function_exists('down_file')) {
|
||||
if (!function_exists('trace_file')) {
|
||||
/**
|
||||
* 输出异常数据到文件.
|
||||
* @param \Throwable $exception 支持 Exception 与 Error(PHP 7+)
|
||||
*/
|
||||
function trace_file(Exception $exception): bool
|
||||
function trace_file(\Throwable $exception): bool
|
||||
{
|
||||
$path = Library::$sapp->getRuntimePath() . 'trace';
|
||||
if (!is_dir($path)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user