upstream_error
HTTP 502 · code upstream_error
A service the server depends on, such as a model provider, failed.
When Photon sends it
Section titled “When Photon sends it”Sent through photonerr.Upstream(cause), typically when a call to a model API fails. On a stream that has already started, the same document arrives as an error event instead of an HTTP status. The cause is logged, never sent.
What the client should do
Section titled “What the client should do”Retry with back-off. On a stream, treat the error event as the end of the answer.
Example response
Section titled “Example response”{ "type": "https://photon.agenticmarket.dev/errors/upstream_error", "title": "upstream error", "status": 502, "code": "upstream_error"}Match on the code field rather than on title, which is meant for people and may change. See all error codes.