@@ -106,7 +106,7 @@ public function discover(string $basePath, array $directories, array $excludeDir
106106 }
107107 } catch (\Throwable $ e ) {
108108 $ this ->logger ->error ('Error during file finding process for MCP discovery ' .json_encode ($ e ->getTrace (), \JSON_PRETTY_PRINT ), [
109- 'exception ' => $ e-> getMessage () ,
109+ 'exception ' => $ e ,
110110 'trace ' => $ e ->getTraceAsString (),
111111 ]);
112112 }
@@ -183,12 +183,12 @@ private function processFile(SplFileInfo $file, array &$discoveredCount, array &
183183 }
184184 }
185185 } catch (\ReflectionException $ e ) {
186- $ this ->logger ->error ('Reflection error processing file for MCP discovery ' , ['file ' => $ file ->getPathname (), 'class ' => $ className , 'exception ' => $ e-> getMessage () ]);
186+ $ this ->logger ->error ('Reflection error processing file for MCP discovery ' , ['file ' => $ file ->getPathname (), 'class ' => $ className , 'exception ' => $ e ]);
187187 } catch (\Throwable $ e ) {
188188 $ this ->logger ->error ('Unexpected error processing file for MCP discovery ' , [
189189 'file ' => $ file ->getPathname (),
190190 'class ' => $ className ,
191- 'exception ' => $ e-> getMessage () ,
191+ 'exception ' => $ e ,
192192 'trace ' => $ e ->getTraceAsString (),
193193 ]);
194194 }
@@ -287,9 +287,9 @@ private function processMethod(\ReflectionMethod $method, array &$discoveredCoun
287287 break ;
288288 }
289289 } catch (ExceptionInterface $ e ) {
290- $ this ->logger ->error ("Failed to process MCP attribute on {$ className }:: {$ methodName }" , ['attribute ' => $ attributeClassName , 'exception ' => $ e-> getMessage () , 'trace ' => $ e ->getPrevious () ? $ e ->getPrevious ()->getTraceAsString () : $ e ->getTraceAsString ()]);
290+ $ this ->logger ->error ("Failed to process MCP attribute on {$ className }:: {$ methodName }" , ['attribute ' => $ attributeClassName , 'exception ' => $ e , 'trace ' => $ e ->getPrevious () ? $ e ->getPrevious ()->getTraceAsString () : $ e ->getTraceAsString ()]);
291291 } catch (\Throwable $ e ) {
292- $ this ->logger ->error ("Unexpected error processing attribute on {$ className }:: {$ methodName }" , ['attribute ' => $ attributeClassName , 'exception ' => $ e-> getMessage () , 'trace ' => $ e ->getTraceAsString ()]);
292+ $ this ->logger ->error ("Unexpected error processing attribute on {$ className }:: {$ methodName }" , ['attribute ' => $ attributeClassName , 'exception ' => $ e , 'trace ' => $ e ->getTraceAsString ()]);
293293 }
294294 }
295295
@@ -338,7 +338,7 @@ private function getClassFromFile(SplFileInfo $file): ?string
338338 $ content = $ file ->getContents ();
339339 } catch (\Throwable $ e ) {
340340 $ this ->logger ->warning ("Failed to read file content during class discovery: {$ file ->getPathname ()}" , [
341- 'exception ' => $ e-> getMessage () ,
341+ 'exception ' => $ e ,
342342 ]);
343343
344344 return null ;
@@ -354,7 +354,7 @@ private function getClassFromFile(SplFileInfo $file): ?string
354354 $ tokens = token_get_all ($ content );
355355 } catch (\Throwable $ e ) {
356356 $ this ->logger ->warning ("Failed to tokenize file during class discovery: {$ file ->getPathname ()}" , [
357- 'exception ' => $ e-> getMessage () ,
357+ 'exception ' => $ e ,
358358 ]);
359359
360360 return null ;
0 commit comments