Skip to content

upstream_error

HTTP 502 · code upstream_error

A service the server depends on, such as a model provider, failed.

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.

Retry with back-off. On a stream, treat the error event as the end of the answer.

{
"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.