Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Conversation

@Nyholm
Copy link
Contributor

@Nyholm Nyholm commented May 25, 2025

No description provided.

@Nyholm Nyholm changed the title Handle json exceptions feat: handle JSON exceptions May 25, 2025
@Nyholm Nyholm force-pushed the json-exceptions branch 3 times, most recently from 005f808 to 0813301 Compare May 25, 2025 13:45
@Nyholm Nyholm force-pushed the json-exceptions branch from efdab60 to 9c79e2e Compare May 25, 2025 13:53
Comment on lines +31 to +39
try {
$response = $this->jsonRpcHandler->process($message);
} catch (\JsonException $e) {
$this->logger->error('Failed to process message', [
'message' => $message,
'exception' => $e,
]);
continue;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about unifying this with the other exception handling?

until now the exception handling is isolated within the JsonRpcHandler, but I'd agree that return null is somehow a bit odd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, the other exception handling may throw a json exception.

That is why I need it here... or double try/catch

@chr-hertel chr-hertel merged commit b4f98ac into php-llm:main May 25, 2025
6 of 7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants