Class in Errors · JavaScript & TypeScript
The client is permanently closing or closed, so reconnecting requires a new client
A REST call that this error ends reports whether its request may have reached Fluxer in outcome, so a write cut off in flight is not repeated blindly. An OAuth request that closure cuts off in flight fails with OAuthError reason network and outcome unknown instead
class ClientClosedError extends FluxerlyErrorclass ClientClosedError
extends FluxerlyErrorConstructor#
new ClientClosedError(
options?: {
readonly outcome?: OperationOutcome
readonly read?: boolean
}
): ClientClosedErrornew ClientClosedError(
options?: {
readonly outcome?:
OperationOutcome
readonly read?: boolean
}
): ClientClosedErrorParameters
optionsoptional-
Settings for the closure
The outcome defaults to undefined and read to false
outcomeoptional-
Whether the closed REST request may have reached Fluxer
OperationOutcome readoptional-
Whether the closed REST request was a read, which cannot have changed anything
Recorded as
detailswhen true, and a read gets no hint to check whether Fluxer applied a change.read boolean
Properties#
_tag#
Discriminator for identifying permanent client closure
readonly _tag: "ClientClosedError"outcome#
Whether the REST request that this closure ended may have reached Fluxer
The outcome is not when the client was already closed or the request was still queued, rejected when closure came while waiting out a rate limit before a retry, and unknown when the request was in flight. An unknown write may already have applied, so check remote state before repeating it with a new client. The preparation steps of a message send, namely opening a direct message and uploading attachments, count as not sent for the message, so a closure during them reports not for the message request even if the earlier step took effect. Undefined for closures that are not a REST request, such as gateway commands, collectors, waits, counts, member chunks, downloads and connecting. Also recorded as details when defined
readonly outcome: OperationOutcome | undefinedreadonly outcome:
| OperationOutcome | undefinedInherited#
Inherited from Fluxerly: code, details, hint, to