SseHttpError class final

Reported on the event stream when the server responds with a non-200 HTTP status. Carries the status code and the response headers, which may hold service directives (e.g. protocol fallback instructions) even on error responses.

recoverable indicates what the client does next:

  • true: the status is one the client retries, so it has scheduled a reconnect with backoff. The subscription stays open; the error is an advisory the consumer may act on (or ignore and let the retry run).
  • false: the client will not retry. It stops reconnecting until connection desire changes.

Only produced by implementations whose transport can observe HTTP responses. The browser's native EventSource cannot, so on html platforms this error is never reported.

Implemented types

Constructors

SseHttpError(int statusCode, Map<String, String> headers, {required bool recoverable})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
The response headers, lower-cased keys as provided by the transport.
final
recoverable bool
Whether the client will retry this connection on its own.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
The HTTP status code of the response.
final

Methods

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

Operators

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