Skip to content

[Platform] Expose API errors for better Developer Experience #528

@chr-hertel

Description

@chr-hertel

Currently the Platform does not really handle API errors well, which is quite a pain for developers when running into errors. It's basically invisible what the API complains about.

For example:

PHP Fatal error: Uncaught Symfony\AI\Platform\Exception\RuntimeException: Response does not contain any content. in /home/christopher/Projects/SymfonyAI/repo/src/platform/src/Bridge/Anthropic/ResultConverter.php:48
Stack trace:
#0 /home/christopher/Projects/SymfonyAI/repo/src/platform/src/Result/ResultPromise.php(48): Symfony\AI\Platform\Bridge\Anthropic\ResultConverter->convert()
#1 /home/christopher/Projects/SymfonyAI/repo/src/platform/src/Result/ResultPromise.php(37): Symfony\AI\Platform\Result\ResultPromise->await()
#2 /home/christopher/Projects/SymfonyAI/repo/src/agent/src/Agent.php(93): Symfony\AI\Platform\Result\ResultPromise->getResult()
#3 /home/christopher/Projects/SymfonyAI/repo/examples/anthropic/image-input-binary.php(32): Symfony\AI\Agent\Agent->call()
#4 {main}
thrown in /home/christopher/Projects/SymfonyAI/repo/src/platform/src/Bridge/Anthropic/ResultConverter.php on line 48

See #167 for inspiration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issueIdeal for your first contribution! (some Symfony experience may be required)Hackathon 2025This issue or pull request was part of the Symfony AI Hackathon 2025PlatformIssues & PRs about the AI Platform component

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions