fetchai/uAgents

Feature: add support for handling json parsing errors

Closed this issue · 0 comments

qati commented

In agent.py:

            try:
                recovered = model_class.parse_raw(message)
            except ValidationError as ex:
                self._logger.warning(f"Unable to parse message: {ex}")
                continue

This piece of code swallows the error and ignores the message. It would be nice to be able to send back a message to the agent who sent the json with the pydantic parse error.