ProviderHttpError class final

A non-200 HTTP response, carrying the status and raw body for error reporting (the Dart counterpart of the SDK error objects pi normalizes).

Implemented types

Constructors

ProviderHttpError(int statusCode, String body, {Duration? retryAfter, RateLimitInfo? rateLimit, Uri? requestUrl, String? redirectLocation, bool answeredHtml = false, bool answeredJson = false})
Creates an HTTP error with statusCode and raw response body.
const

Properties

answeredHtml → bool
True when the endpoint answered 200 OK with an HTML page instead of the event stream — the signature of an SSO-gated API whose session died: the transparent redirect (browser jar / fetch follows 3xx) lands on the login portal, and without this flag the adapter would finish with an EMPTY assistant message and no hint why.
final
answeredJson → bool
True when the endpoint answered 200 OK with a buffered JSON body instead of the event stream — a gateway/front-proxy error object ({"error": …}) that never went through SSE framing. The body is short and diagnostic, so formatProviderError surfaces it (unlike the HTML login page, which is transcript junk).
final
body → String
The raw response body.
final
hashCode → int
The hash code for this object.
no setterinherited
rateLimit → RateLimitInfo?
The structured 429 decode (issue #867), when the failure was a rate limit. formatProviderError renders it human; the raw payload stays inside for diagnostics.
final
redirectLocation → String?
Location response header on a redirect response, when present.
final
requestUrl → Uri?
Request URL that produced the error, when known.
final
retryAfter → Duration?
The provider-suggested delay before retrying (parsed from the Retry-After response header), typically set on HTTP 429 responses.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
statusCode → int
The HTTP status code.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited