Skip to content

Commit 536f8c2

Browse files
committed
changes
1 parent 9b8957d commit 536f8c2

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

src/ExceptionHandler.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,21 @@ function nuclearOption(){
204204
return "<h1>Please do not use the ExceptionHandler for non-exceptions.</h1>" . $this->eol(3);
205205
}
206206

207+
function chain(\Exception $e){
208+
$info = [];
209+
while($e){
210+
$info[] = [
211+
"e.type" => get_class($e),
212+
"e.message" => $e->getMessage(),
213+
"e.code" => $e->getCode(),
214+
"e.severity" => $this->getSeverity($e),
215+
"e.file" => $e->getFile(),
216+
"e.line" => $e->getLine(),
217+
];
218+
219+
$e = $e->getPrevious();
220+
}
221+
return $info;
222+
}
223+
207224
}

src/ExceptionLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function logException(\Exception $e, array $context = []){
3434
$i = 1;
3535

3636
while($e && $i){
37-
$context += [
37+
$context += [
3838
"e.[{$i}].type" => get_class($e),
3939
"e.[{$i}].message" => $e->getMessage(),
4040
"e.[{$i}].code" => $e->getCode(),

0 commit comments

Comments
 (0)