From a3e8d8f0d456d09cb7cc0f26080b1357d47e8653 Mon Sep 17 00:00:00 2001 From: Ibrahim BinAlshikh Date: Wed, 21 Sep 2022 18:31:28 +0300 Subject: [PATCH] Update AbstractHandler.php --- src/webfiori/error/AbstractHandler.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/webfiori/error/AbstractHandler.php b/src/webfiori/error/AbstractHandler.php index ad98467..178c318 100644 --- a/src/webfiori/error/AbstractHandler.php +++ b/src/webfiori/error/AbstractHandler.php @@ -141,9 +141,22 @@ private function setTrace() { $this->traceArr = $ex->getDebugTrace(); } else { $trace = $ex->getTrace(); - + $currentLine = isset($trace[0]['line']) ? $trace[0]['line'] : 'X'; + $currentFile = isset($trace[0]['file']) ? $trace[0]['file'] : 'X'; + $nextLine = ''; + $nextFile = ''; + $idx = 0; foreach ($trace as $traceEntry) { - $this->traceArr[] = new TraceEntry($traceEntry); + if ($idx != 0) { + $nextFile = isset($traceEntry['file']) ? $traceEntry['file'] : 'X'; + $nextLine = isset($traceEntry['line']) ? $traceEntry['line'] : 'X'; + $traceEntry['file'] = $currentFile; + $traceEntry['line'] = $currentLine; + $this->traceArr[] = new TraceEntry($traceEntry); + $currentFile = $nextFile; + $currentLine = $nextLine; + } + $idx++; } } }