From b04c7d2938b8cab94b6c9f39765382a7319af628 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 11 Apr 2013 11:28:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BError=E7=B1=BB=20=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E5=BC=82=E5=B8=B8=E9=A1=B5=E9=9D=A2=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=96=87=E4=BB=B6=E5=AE=9A=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Think/Error.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Think/Error.php b/Think/Error.php index da9807ec..64e5d2f5 100644 --- a/Think/Error.php +++ b/Think/Error.php @@ -20,8 +20,14 @@ class Error { static public function appException($e) { $error = []; $error['message'] = $e->getMessage(); - $error['file'] = $e->getFile(); - $error['line'] = $e->getLine(); + $trace = $e->getTrace(); + if('E'==$trace[0]['function']) { + $error['file'] = $trace[0]['file']; + $error['line'] = $trace[0]['line']; + }else{ + $error['file'] = $e->getFile(); + $error['line'] = $e->getLine(); + } $error['trace'] = $e->getTraceAsString(); self::halt($error); }