@@ -12,6 +12,7 @@ class ErrorWrapper
1212 private $ sourceMethod ;
1313
1414 const TYPE_STRING_EXCEPTION = 'StringException ' ;
15+ const UNKNOWN_METHOD = '{unknown} ' ;
1516
1617 /**
1718 * @var \Stackify\Log\Entities\ErrorWrapper
@@ -24,7 +25,12 @@ public function __construct($object, $nestingLevel = 1)
2425 $ this ->message = $ object ->getMessage ();
2526 $ this ->type = get_class ($ object );
2627 $ this ->code = $ object ->getCode ();
27- $ this ->setTrace ($ object ->getTrace ());
28+ $ trace = $ object ->getTrace ();
29+ $ trace [] = array (
30+ 'file ' => $ object ->getFile (),
31+ 'line ' => $ object ->getLine (),
32+ );
33+ $ this ->setTrace ($ trace );
2834 $ previous = $ object ->getPrevious ();
2935 if (null !== $ previous ) {
3036 // limit nesting level if needed here
@@ -80,7 +86,11 @@ private function setTrace(array $trace)
8086 {
8187 $ result = array ();
8288 foreach ($ this ->filterTrace ($ trace ) as $ index => $ item ) {
83- $ function = $ item ['function ' ] . '() ' ;
89+ if (isset ($ item ['function ' ])) {
90+ $ function = $ item ['function ' ] . '() ' ;
91+ } else {
92+ $ function = self ::UNKNOWN_METHOD ;
93+ }
8494 if (isset ($ item ['class ' ])) {
8595 // type is -> or :: which means dynamic or static method call
8696 $ type = isset ($ item ['type ' ]) ? $ item ['type ' ] : '-> ' ;
0 commit comments