This comment says that we can indicate errors using and is_error flag:
https://github.com/anthropics/claude-agent-sdk-python/blob/main/src/claude_agent_sdk/__init__.py#L136
But the code does not take into account and only returns the text or image content:
https://github.com/anthropics/claude-agent-sdk-python/blob/main/src/claude_agent_sdk/__init__.py#L300-L309
I am using the result in the PostToolUse hook and I need the is_error flag to log failures of my tools in the DB.