Skip to content

Commit b36787a

Browse files
committed
Apply review feedback
1 parent eb9cc45 commit b36787a

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/Capability/Discovery/Discoverer.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ public function discover(string $basePath, array $directories, array $excludeDir
114114
} catch (\Throwable $e) {
115115
$this->logger->error('Error during file finding process for MCP discovery'.json_encode($e->getTrace(), \JSON_PRETTY_PRINT), [
116116
'exception' => $e,
117-
'trace' => $e->getTraceAsString(),
118117
]);
119118
}
120119

@@ -196,7 +195,6 @@ private function processFile(SplFileInfo $file, array &$discoveredCount, array &
196195
'file' => $file->getPathname(),
197196
'class' => $className,
198197
'exception' => $e,
199-
'trace' => $e->getTraceAsString(),
200198
]);
201199
}
202200
}
@@ -297,9 +295,15 @@ private function processMethod(\ReflectionMethod $method, array &$discoveredCoun
297295
break;
298296
}
299297
} catch (ExceptionInterface $e) {
300-
$this->logger->error("Failed to process MCP attribute on {$className}::{$methodName}", ['attribute' => $attributeClassName, 'exception' => $e, 'trace' => $e->getPrevious() ? $e->getPrevious()->getTraceAsString() : $e->getTraceAsString()]);
298+
$this->logger->error("Failed to process MCP attribute on {$className}::{$methodName}", [
299+
'attribute' => $attributeClassName,
300+
'exception' => $e,
301+
]);
301302
} catch (\Throwable $e) {
302-
$this->logger->error("Unexpected error processing attribute on {$className}::{$methodName}", ['attribute' => $attributeClassName, 'exception' => $e, 'trace' => $e->getTraceAsString()]);
303+
$this->logger->error("Unexpected error processing attribute on {$className}::{$methodName}", [
304+
'attribute' => $attributeClassName,
305+
'exception' => $e,
306+
]);
303307
}
304308
}
305309

src/Capability/Discovery/DocBlockParser.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ public function parseDocBlock(string|false|null $docComment): ?DocBlock
4747
} catch (\Throwable $e) {
4848
// Log error or handle gracefully if invalid DocBlock syntax is encountered
4949
$this->logger->warning('Failed to parse DocBlock', [
50-
'error' => $e->getMessage(),
5150
'exception' => $e,
52-
'exception_trace' => $e->getTraceAsString(),
5351
]);
5452

5553
return null;

src/Capability/Discovery/SchemaValidator.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ public function validateAgainstJsonSchema(mixed $data, array|object $schema): ar
8888
} catch (\Throwable $e) {
8989
$this->logger->error('MCP SDK: JSON Schema validation failed internally.', [
9090
'exception' => $e,
91-
'exception_message' => $e->getMessage(),
92-
'exception_trace' => $e->getTraceAsString(),
9391
'data' => json_encode($dataToValidate),
9492
'schema' => json_encode($schemaObject),
9593
]);

src/Client/Transport/HttpTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function close(): void
170170
$this->httpClient->sendRequest($request);
171171
$this->logger->info('Session closed', ['session_id' => $this->sessionId]);
172172
} catch (\Throwable $e) {
173-
$this->logger->warning('Failed to close session', ['error' => $e->getMessage(), 'exception' => $e]);
173+
$this->logger->warning('Failed to close session', ['exception' => $e]);
174174
}
175175
}
176176

0 commit comments

Comments
 (0)