On This Page

Errors

94 symbols from @neontechspace/fluxerly

Functions#

describeError#

Describe any error as readable multi-line text: Its name, SDK code, message, suggested fix, safe details and cause chain

Works for SDK errors, application errors, thrown non-Error values and Effect Causes, and never throws. A Cause is described reason by reason, as Failure, Defect or Interrupted, so pass exit.cause directly rather than squashing it first. Credential patterns, such as Authorization values, bare bot tokens, values assigned to keys ending in token or secret, token-shaped Bot or Bearer values, webhook URL tokens and the user information of a URL, such as user:password in https://user:password@host/path, are masked in names, application error codes, messages and stacks. A client's own configured token is masked only in that client's log records and failure reports. Use it to print a failed Result, an SdkDefect or a FailureReport's error

describeError(
    error: unknown,
    options?: DescribeErrorOptions
): stringdescribeError(
  error: unknown,
  options?: DescribeErrorOptions
): string

Parameters

error
unknown
options optional
DescribeErrorOptions
Returns
string
import { createClient, describeError, orThrow } from "@neontechspace/fluxerly"

try {
    await using client = createClient({ token: process.env.FLUXER_BOT_TOKEN })
    orThrow(await client.run())
}
catch (error) {
    // Configuration errors, connection failures and SDK defects all print with their cause chain
    console.error(describeError(error))
}
import { createClient, describeError, orThrow } from "@neontechspace/fluxerly"

try {
    await using client = createClient({ token: process.env.FLUXER_BOT_TOKEN })
    orThrow(await client.run())
} catch (error) {
    // Configuration errors, connection failures and SDK defects all print with their cause chain
    console.error(describeError(error))
}

orThrow#

Return the value of an Ok result, or throw the error of an Err result

Use it where a failure should end the surrounding function, such as a command handler whose thrown error is reported with the command name, or a startup script that should stop with the SDK's message and hint. The thrown value is the operation's own error, so its message, hint, code and cause remain available

orThrow<T, E>(result: Result<T, E>): TorThrow<T, E>(
  result: Result<T, E>
): T

Parameters

result
Result<T, E>
Returns
T

A ResultAsync, or any promise of a Result, returns a Promise that resolves with the value or rejects with the error. Keep checking isErr() where the application must recover from a particular failure instead

import { orThrow } from "@neontechspace/fluxerly"

export async function greet(client, channelId) {
    const message = orThrow(await client.messages.send(channelId, { content: "Hello" }))
    return orThrow(client.messages.edit(message, { content: "Hello again" }))
}
import { orThrow, type Client } from "@neontechspace/fluxerly"

export async function greet(client: Client, channelId: string) {
    const message = orThrow(await client.messages.send(channelId, { content: "Hello" }))
    return orThrow(client.messages.edit(message, { content: "Hello again" }))
}

Wait for a ResultAsync, or any promise of a Result, and resolve with its value or reject with its error

orThrow<T, E>(result: PromiseLike<Result<T, E>>): Promise<T>orThrow<T, E>(
  result: PromiseLike<Result<T, E>>
): Promise<T>

Parameters

result
PromiseLike<Result<T, E>>
Returns
Promise<T>

Variables#

errors#

Error helpers that classify and match errors through apiCode, isNotFound, isRetryable, retryAfterMs, outcome and match

To print an error, use describeError

const errors: ErrorTools
import { describeError, errors } from "@neontechspace/fluxerly"

export async function sendWithOneRetry(client, channelId) {
    let sent = await client.messages.send(channelId, { content: "Hello" })
    if (sent.isErr() && errors.isRetryable(sent.error))
        sent = await client.messages.send(channelId, { content: "Hello" })
    if (sent.isErr() && errors.isNotFound(sent.error, "channel"))
        return console.warn("The channel was not found")
    if (sent.isErr() && errors.apiCode(sent.error) === "missingPermissions")
        return console.warn("The bot cannot post here")
    if (sent.isErr() && errors.outcome(sent.error) === "rejected")
        return console.warn("Fluxer refused the message", describeError(sent.error))
    if (sent.isErr() && errors.outcome(sent.error) !== "notDispatched")
        return console.warn("The message may have been sent, so check the channel before sending it again")
    // Only a request that was not dispatched is safe to send again
    if (sent.isErr())
        errors.match(sent.error, {
            MessageError: (error) => console.warn("The message was not sent", error.reason),
            _: (error) => console.error(describeError(error)),
        })
}
import { describeError, errors, type Client } from "@neontechspace/fluxerly"

export async function sendWithOneRetry(client: Client, channelId: string) {
    let sent = await client.messages.send(channelId, { content: "Hello" })
    if (sent.isErr() && errors.isRetryable(sent.error)) sent = await client.messages.send(channelId, { content: "Hello" })
    if (sent.isErr() && errors.isNotFound(sent.error, "channel")) return console.warn("The channel was not found")
    if (sent.isErr() && errors.apiCode(sent.error) === "missingPermissions") return console.warn("The bot cannot post here")
    if (sent.isErr() && errors.outcome(sent.error) === "rejected")
        return console.warn("Fluxer refused the message", describeError(sent.error))
    if (sent.isErr() && errors.outcome(sent.error) !== "notDispatched")
        return console.warn("The message may have been sent, so check the channel before sending it again")
    // Only a request that was not dispatched is safe to send again
    if (sent.isErr())
        errors.match(sent.error, {
            MessageError: (error) => console.warn("The message was not sent", error.reason),
            _: (error) => console.error(describeError(error)),
        })
}

Classes#

ApplicationError
An application callback invoked by the SDK failed, threw or rejected
AssetUrlError
The SDK could not make an asset URL from the supplied input
AttachmentDownloadError
Expected bounded attachment-download failure, without a URL, response body or credential
AttachmentRefreshError
The SDK could not refresh one ordered batch of attachment URL strings
AuthenticationError
Fluxer rejected the bot token during connection startup or recovery
BotApplicationOperationError
The SDK could not read the current bot application
CancelledError
A default API operation was cancelled through its signal
ChannelOperationError
Expected failure when reading or changing community channels, threads and forum tags
ClientBusyError
A competing connection operation already owns the client, so this call did not take ownership
ClientClosedError
The client is permanently closing or closed, so reconnecting requires a new client
CollectorError
Expected collector failure, separate from results that stop at the count, deadline, idle deadline or explicit stop
ConfigurationError
A client setting or operation option is invalid before the requested work starts
ConnectionError
Instance discovery or the gateway connection failed
ConnectionTimeoutError
Gateway startup or explicit instance discovery exceeded its time budget
CountOperationError
A fresh gateway-count call could not return its complete result
CriticalWorkerStoppedError
One of the bot's event or command subscriptions ended while its client was still running
EventOverflowError
An event subscription stopped because unread events exceeded its count or byte limit
EventReadBusyError
A second next call tried to read while the same default API pull subscription already had a pending read
EventWaitError
A filtered event wait ended without a match or could not use its synchronous filter
FluxerlyError
Base class for every error the SDK returns, throws or reports, in both entry points
GatewaySendError
Why gateway.send did not hand a command to the shard's connection
GuildOperationError
Expected failure from guild, member, role and related resource operations
HelperError
A helper could not use its input
MemberChunkError
A member stream stopped before it could return every batch
MessageCleanupError
A cleanup preview or deletion failed, with selected IDs and batch progress where available
MessageError
A send, reply or forward ended without confirming that Fluxer created the message
MessageOperationError
A message lookup, read or change failed
OAuthOperationError
An OAuth call failed an input check, reached a local capacity limit, or failed during its request or response
PaginationError
Reading multiple pages failed because of invalid settings, a page limit, a stalled cursor or search readiness
PresenceError
The SDK rejected a status update or member-presence selection before changing its saved settings
RateLimitError
Discovery HTTP or the gateway imposed a connection rate limit
SdkDefect
An unexpected fault thrown or rejected by the default API instead of returned as a typed error result
ShardConnectionError
A configured gateway shard failed startup or permanently lost its established connection
SupervisorChildError
Child-helper failure because the parent's message channel is unavailable or carries invalid coordination data
SupervisorError
Parent-process lifecycle failure, not the child's original client or configuration error
UserOperationError
Expected failure from account reads or private-conversation operations
WebhookOperationError
An expected failure while managing a webhook or one of its messages

Interfaces#

ApiErrorDetail#

Safe details about a Fluxer API rejection, available in an operation error's apiError field

The code is the SDK's category. The providerCode is the exact server code that the SDK recognizes. The explanation is fixed SDK text, not the server's message or text to show directly to users. If the SDK does not recognize the server code, apiError is null rather than containing unreviewed text, and the error's details.providerCode names the unrecognized code when it is an uppercase code of at most 64 characters. For form errors, validationErrors contains at most 32 validation codes with their field paths, without messages or rejected values. These details never contain the response body, localized message, rejected value or private caller data. Responses from presigned upload destinations do not receive this classification

interface ApiErrorDetail

For code missingPermissions, the operation error's details.requiredPermissions lists the permissions that Fluxer checks for the failed operation, as keys of Permissions such as ViewChannel, and the error's hint names them. Fluxer does not report which one is missing, so the bot may already have some of them. The list covers the operation's usual path, and the hint adds other checks behind the same rejection, such as role hierarchy or a permission that only some inputs need. Other rejections, rest.request and operations whose checks depend on data the SDK does not have, such as who created an emoji, carry no details.requiredPermissions and keep a general hint

export function formatApiErrorDetail(detail) {
    // Branch on the category, which groups related server codes such as every resource limit
    if (detail.code === "resourceLimit")
        return `Limit reached: ${detail.explanation}`
    const fields = detail.validationErrors?.map((error) => error.path ?? error.providerCode) ?? []
    return `${detail.providerCode}: ${detail.explanation}${fields.length > 0 ? ` (${fields.join(", ")})` : ""}`
}
import type { ApiErrorDetail } from "@neontechspace/fluxerly"

export function formatApiErrorDetail(detail: ApiErrorDetail): string {
    // Branch on the category, which groups related server codes such as every resource limit
    if (detail.code === "resourceLimit") return `Limit reached: ${detail.explanation}`
    const fields = detail.validationErrors?.map((error) => error.path ?? error.providerCode) ?? []
    return `${detail.providerCode}: ${detail.explanation}${fields.length > 0 ? ` (${fields.join(", ")})` : ""}`
}
code#

Stable SDK category for this recognized rejection

Several Fluxer codes can share one category

ApiErrorCode
explanation#

Fixed SDK explanation, never Fluxer's localized response text

string
providerCode#

Exact recognized Fluxer server code

ApiProviderCode
validationErrors optional#

Present only when code is invalidFormBody

Holds at most 32 validation codes with field paths, without Fluxer messages or rejected values

readonly ApiValidationErrorDetail[]

ApiValidationErrorDetail#

A validation error reported by Fluxer, with a fixed SDK explanation

This is a server rejection, not a problem found by local input checks. It includes the rejected field path when Fluxer supplied one, but never the rejected value or localized server message

interface ApiValidationErrorDetail
explanation#

Fixed SDK explanation of the validation code

string
path optional#

Request field path that Fluxer rejected, such as embeds.0.title, when supplied in a plain dotted form

string
providerCode#

Fluxer validation code

A code this SDK version does not recognize is kept when it is an uppercase code of at most 64 characters, with a generic explanation, so its field path is not lost

ApiValidationCode | string & { … }

DescribeErrorOptions#

Settings for describeError

interface DescribeErrorOptions
stack optional#

Include stack frames for each error in the cause chain

Defaults to true. Consecutive frames inside the SDK and Effect collapse into one line, and expected SDK errors other than ConfigurationError and SdkDefect print no frames, because their stacks only show SDK internals

boolean

ErrorTools#

Helpers for inspecting SDK errors in either entry point

interface ErrorTools
apiCode#

The recognized Fluxer rejection category of an operation error, such as "missingPermissions", read from its apiError

Returns undefined for any other value, including cancellation, closed clients, invalid input and rejections Fluxer did not describe with a recognized code, so one condition works on every error of an operation's Result

(error: unknown) => ApiErrorCode | undefined(error: unknown)
  => ApiErrorCode | undefined
isNotFound#

Whether the value is an SDK error for an HTTP 404, such as a deleted channel or a member who left

Fluxer answers UNKNOWN_CHANNEL for a missing channel and also for message and reaction requests in a thread from a bot that is no longer in the community. Other requests from such a bot get a 403 missingPermissions, so a 404 does not tell why a resource is missing. The check reads the error's HTTP status, so it also holds for a 404 that an operation reports with reason rejected, such as messages.send to a missing channel. Pass a resource, such as "member", to also require that Fluxer named that resource as the missing one, which separates a missing member from a missing guild. A thread counts as a "channel". A 404 without a recognized Fluxer code is true without a resource and false with one. Returns false for any other value, so one condition works on every error of an operation's Result. Throws HelperError with operation errors.isNotFound and reason resource for a resource that is not a NotFoundResource, which is a defect in the native API. A 404 does not prove that an earlier deletion succeeded

(error: unknown, resource?: NotFoundResource) => boolean(
  error: unknown,
  resource?: NotFoundResource
) => boolean
isRetryable#

Whether repeating the same call is safe and may succeed, such as after a rate limit, full local capacity, or a network failure or timeout of a read or of a write that was not sent

A write whose outcome is unknown is not retryable, because Fluxer may already have applied it. Rejections, invalid input, cancellation and closed clients are never retryable, because a closed client cannot send again and a new client is needed. An Effect Cause, such as that of a failed Exit, is retryable only when it has at least one reason and every reason is a retryable failure. A defect, an interruption or an empty Cause gives false, because the work may have stopped part-way. Concurrent forEach and all can drop the reasons of siblings they interrupt, as described for outcome, so for several concurrent writes check each item's own result rather than the combined Cause

(error: unknown) => boolean
match#

Call the handler named by the error's _tag, or the _ fallback, and return its result

Returns undefined when no handler applies

<E, R>(error: E, handlers: ErrorMatchHandlers<E, R>)
    => R | undefined<E, R>(
  error: E,
  handlers: ErrorMatchHandlers<E, R>
) => R | undefined
outcome#

Whether the failed request may have reached Fluxer: "notDispatched" when it was not sent, "rejected" when Fluxer refused it and "unknown" when the result is uncertain, such as a write whose response was lost

An unknown write may already have applied, so check remote state before repeating it. Only "notDispatched" shows that a write was not sent. Treat every other value, including undefined, as a write that may have applied, and reconcile before sending it again. Reads the outcome of an SDK error, including a closed client's, and for an Effect Cause the least certain outcome of its failures, where unknown outranks rejected and rejected outranks notDispatched. A Cause covers only the failures it kept. Effect's concurrent forEach and all drop the reasons of siblings that they interrupt, so for several concurrent writes check each item's own result, such as with { mode: "result" } or Effect.result, instead of the combined Cause. Returns undefined when the SDK cannot establish an outcome, so the caller applies its own policy. That holds for errors without an outcome, such as CancelledError, SdkDefect, collector and gateway failures and non-SDK values, and for a Cause that is empty or holds a defect, an interruption or a failure without an outcome. For a multi-step operation the outcome covers the failed step, not the steps before it. 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 "notDispatched" for the message request even if the earlier step took effect. Wrapping an SDK call in Effect.timeout yields only a TimeoutError, which has no outcome, so pass the operation's timeoutMs option instead to keep it. A default-API CancelledError carries no outcome either

(error: unknown) => OperationOutcome | undefined(error: unknown)
  => OperationOutcome | undefined
retryAfterMs#

How many milliseconds to wait before repeating the call, as Fluxer or the SDK's own rate limiting requires

It reads the error's retryAfterMs, which every operation error and RateLimitError carries when the wait is known. For a ShardConnectionError it is the wait of the failure that stopped the shard. For an Effect Cause it is the longest wait among its failures, which covers all of them, and defects and interruptions in the Cause are ignored. Returns undefined when there is no usable wait, including for a value that is not an SDK error, so the caller can use its own backoff. It never throws. It does not say whether repeating the call is safe, so check isRetryable too

(error: unknown) => number | undefined

FluxerlyErrorJson#

The JSON form of an SDK error, produced by toJSON

Credential patterns are masked in error names and messages, including summarized causes. SDK codes remain fixed identifiers

interface FluxerlyErrorJson
_tag#

Error class discriminator, such as GuildOperationError

string
cause optional#

Summary of the underlying cause, when one was retained

| FluxerlyErrorJson
| { readonly message: string; readonly name: string }| FluxerlyErrorJson
| {
    readonly message: string
    readonly name: string
  }
code#

Stable dotted failure code

string
details#

Safe structured facts about the failure

Readonly<Record<string, unknown>>
hint optional#

Actionable next step, when available

string
message#

Human-readable message

string
name#

Error name, normally equal to _tag

string

FluxerlyErrorOptions#

Settings shared by SDK error constructors

interface FluxerlyErrorOptions
cause optional#

Underlying failure, exposed as the standard ES2022 cause property

unknown
code#

Stable dotted identifier for this failure, such as configuration.invalid or guild.rateLimit

string
details optional#

Safe structured facts about the failure, without credentials or private payloads

Readonly<Record<string, unknown>>
hint optional#

Actionable next step for a person reading the error, when the SDK can suggest one

string

InputValidationDetail#

Describes why the SDK rejected an input without keeping the rejected value

Read this detail from an operation error's inputValidation field when it is non-null. The path names the input field, constraint names the rule, and explanation describes what the SDK accepts. The SDK reports the first failure it can describe, not every invalid field. Paths and explanations are SDK-authored, with no rejected values or provider responses. Every operation input, query and options object rejects keys it does not support before sending, with constraint allowedFields. The explanation names the key when it is a short identifier, such as a misspelled field name, suggests the closest supported key and lists the supported keys. Write application-specific user-facing messages rather than displaying this diagnostic as application copy

interface InputValidationDetail
export function readInputValidation(error) {
    return error._tag === "MessageOperationError" ? error.inputValidation : null
}
import type { InputValidationDetail, MessageOperationFailure } from "@neontechspace/fluxerly"
export function readInputValidation(error: MessageOperationFailure): InputValidationDetail | null {
    return error._tag === "MessageOperationError" ? error.inputValidation : null
}
constraint#

Kind of rule the input failed, suitable for application-specific error handling

InputValidationConstraint
explanation#

Fixed SDK explanation of the accepted input, not the rejected value or ready-made application text

string
path#

Field or input path the SDK identified as invalid, without copying arbitrary caller keys

string

MessageCleanupFailureMetadata#

Expected batch failure details included in a failed progress notification

Contains SDK-owned classifications, not message bodies, filter details or raw provider response text

interface MessageCleanupFailureMetadata
apiError#

Safe Fluxer rejection classification, or null, excluding raw response text and provider field paths

ApiErrorDetail | null
outcome#

What is known about dispatch: Not sent, definitively rejected, or uncertain

MessageCleanupOutcome
reason#

Classified cause of the failure, such as invalid input, closure, rejection or deadline expiry

MessageCleanupErrorReason
retryAfterMs#

Retry delay reported by Fluxer in milliseconds, or null

This does not establish that retrying is safe

number | null
status#

Known HTTP status, or null when none is available

number | null

OperationErrorOptions#

Constructor settings shared by resource operation errors, such as GuildOperationError and MessageOperationError

interface OperationErrorOptions<
    Operation extends string,
    Reason extends string = OperationReason
>interface OperationErrorOptions<
  Operation extends string,
  Reason extends string
    = OperationReason
>
apiError optional#

Safe classification of a Fluxer rejection

Defaults to null

ApiErrorDetail | null
cause optional#

Underlying failure retained as the error's cause

unknown
inputValidation optional#

Safe explanation of locally invalid input

Defaults to null

InputValidationDetail | null
operation#

The failed step

Operation
outcome#

Whether the request may have reached Fluxer

OperationOutcome
providerCode optional#

Fluxer error code that this SDK version does not recognize, recorded as details.providerCode and named in the message

Kept only when apiError is null and the code is an uppercase code of at most 64 characters. Defaults to null

string | null
read optional#

Whether the failed request only read data, so even an unknown outcome cannot have changed remote state

A read is recorded as details.read and keeps network and timeout failures retryable. Defaults to false

boolean
reason#

Failure category

Reason
responseField optional#

For reason response, the response field path or named check that failed, such as type or channelMismatch

Recorded as details.responseField and named in the message. Defaults to null

string | null
retryAfterMs optional#

Usable server-required retry wait in milliseconds

Defaults to null

number | null
status optional#

HTTP status when available

Defaults to null

number | null

Type Aliases#

ApiErrorCode#

Stable SDK category of a recognized Fluxer API rejection, read from ApiErrorDetail.code

Branch on this rather than on providerCode when several server codes mean the same thing, such as every resource limit. Announcement, follow, channel conversion and publishing preconditions have distinct categories. Publishing and published-message editing limits are separate from the general rateLimited category. Thread state, forum tag and webhook post preconditions also have distinct categories, while the thread, tag and pinned-post limits join resourceLimit and a missing forum tag or thread member joins unknownResource

type ApiErrorCode =
    | "missingAccess" | "missingPermissions"
    | "communicationDisabled" | "cannotSendMessagesToUser"
    | "cannotSendEmptyMessage" | "cannotModifySystemWebhook"
    | "announcementChannelRequired" | "channelAlreadyFollowed"
    | "channelHasFollowedChannels"
    | "channelTypeConversionNotSupported"
    | "followTargetContentWarningRequired"
    | "followTargetNotAgeRestricted" | "invalidFollowTargetChannel"
    | "messageAlreadyCrossposted" | "messageNotCrosspostable"
    | "messageCrosspostRateLimited"
    | "publishedMessageEditRateLimited" | "invalidChannelType"
    | "channelHasThreads" | "threadAlreadyCreated"
    | "threadArchived" | "threadLocked" | "forumTagNamesNotUnique"
    | "forumTagRequired" | "noTagsAvailable"
    | "mediaChannelRequired" | "webhookForumTargetRequired"
    | "webhookThreadNameRequiresForum" | "captchaRequired"
    | "invalidCaptcha" | "invalidFormBody" | "unknownResource"
    | "missingOAuthScope" | "cannotEditOtherUserMessage"
    | "cannotSendMessagesInNonTextChannel" | "contentBlocked"
    | "directMessagesDisabled" | "explicitContentCannotBeSent"
    | "fileSizeTooLarge" | "featureTemporarilyDisabled"
    | "slowmodeRateLimited" | "guildVerificationRequired"
    | "twoFactorRequired" | "botAlreadyInGuild" | "botIsPrivate"
    | "notBotApplication" | "applicationNotOwned" | "resourceLocked"
    | "accessDenied" | "badRequest" | "conflict" | "forbidden"
    | "notFound" | "rateLimited" | "serviceUnavailable"
    | "unauthorized" | "gone" | "serviceFailure" | "notImplemented"
    | "cannotExecuteOnDirectMessage" | "invitesDisabled"
    | "featureNotAvailableSelfHosted" | "resourceLimit"type ApiErrorCode =
    | "missingAccess"
    | "missingPermissions"
    | "communicationDisabled"
    | "cannotSendMessagesToUser"
    | "cannotSendEmptyMessage"
    | "cannotModifySystemWebhook"
    | "announcementChannelRequired"
    | "channelAlreadyFollowed"
    | "channelHasFollowedChannels"
    | "channelTypeConversionNotSupported"
    | "followTargetContentWarningRequired"
    | "followTargetNotAgeRestricted"
    | "invalidFollowTargetChannel"
    | "messageAlreadyCrossposted"
    | "messageNotCrosspostable"
    | "messageCrosspostRateLimited"
    | "publishedMessageEditRateLimited"
    | "invalidChannelType"
    | "channelHasThreads"
    | "threadAlreadyCreated"
    | "threadArchived"
    | "threadLocked"
    | "forumTagNamesNotUnique"
    | "forumTagRequired"
    | "noTagsAvailable"
    | "mediaChannelRequired"
    | "webhookForumTargetRequired"
    | "webhookThreadNameRequiresForum"
    | "captchaRequired"
    | "invalidCaptcha"
    | "invalidFormBody"
    | "unknownResource"
    | "missingOAuthScope"
    | "cannotEditOtherUserMessage"
    | "cannotSendMessagesInNonTextChannel"
    | "contentBlocked"
    | "directMessagesDisabled"
    | "explicitContentCannotBeSent"
    | "fileSizeTooLarge"
    | "featureTemporarilyDisabled"
    | "slowmodeRateLimited"
    | "guildVerificationRequired"
    | "twoFactorRequired"
    | "botAlreadyInGuild"
    | "botIsPrivate"
    | "notBotApplication"
    | "applicationNotOwned"
    | "resourceLocked"
    | "accessDenied" | "badRequest"
    | "conflict" | "forbidden"
    | "notFound" | "rateLimited"
    | "serviceUnavailable"
    | "unauthorized" | "gone"
    | "serviceFailure"
    | "notImplemented"
    | "cannotExecuteOnDirectMessage"
    | "invitesDisabled"
    | "featureNotAvailableSelfHosted"
    | "resourceLimit"

ApiProviderCode#

Exact Fluxer server code that the SDK recognizes, read from ApiErrorDetail.providerCode

An unrecognized server code produces no ApiErrorDetail

type ApiProviderCode =
    | "MISSING_ACCESS" | "MISSING_PERMISSIONS"
    | "COMMUNICATION_DISABLED" | "CANNOT_SEND_MESSAGES_TO_USER"
    | "CANNOT_SEND_EMPTY_MESSAGE" | "CANNOT_MODIFY_SYSTEM_WEBHOOK"
    | "ANNOUNCEMENT_CHANNEL_REQUIRED" | "CHANNEL_ALREADY_FOLLOWED"
    | "CHANNEL_HAS_FOLLOWED_CHANNELS"
    | "CHANNEL_TYPE_CONVERSION_NOT_SUPPORTED"
    | "FOLLOW_TARGET_CONTENT_WARNING_REQUIRED"
    | "FOLLOW_TARGET_NOT_AGE_RESTRICTED"
    | "INVALID_FOLLOW_TARGET_CHANNEL"
    | "MESSAGE_ALREADY_CROSSPOSTED" | "MESSAGE_NOT_CROSSPOSTABLE"
    | "MESSAGE_CROSSPOST_RATE_LIMITED"
    | "PUBLISHED_MESSAGE_EDIT_RATE_LIMITED" | "INVALID_CHANNEL_TYPE"
    | "CHANNEL_HAS_THREADS" | "THREAD_ALREADY_CREATED_FOR_MESSAGE"
    | "THREAD_ARCHIVED" | "THREAD_LOCKED"
    | "FORUM_TAG_NAMES_MUST_BE_UNIQUE" | "FORUM_TAG_REQUIRED"
    | "NO_TAGS_AVAILABLE_TO_NON_MODERATORS"
    | "HIDE_MEDIA_DOWNLOAD_OPTION_MEDIA_ONLY"
    | "WEBHOOK_FORUM_TARGET_REQUIRED"
    | "WEBHOOK_THREAD_NAME_REQUIRES_FORUM" | "CAPTCHA_REQUIRED"
    | "INVALID_CAPTCHA" | "INVALID_FORM_BODY" | "VALIDATION_ERROR"
    | "UNKNOWN_APPLICATION" | "UNKNOWN_CHANNEL" | "UNKNOWN_EMOJI"
    | "UNKNOWN_FORUM_TAG" | "UNKNOWN_GUILD" | "UNKNOWN_INVITE"
    | "UNKNOWN_MEMBER" | "UNKNOWN_MESSAGE" | "UNKNOWN_ROLE"
    | "UNKNOWN_STICKER" | "UNKNOWN_THREAD_MEMBER" | "UNKNOWN_USER"
    | "UNKNOWN_WEBHOOK" | "MISSING_OAUTH_SCOPE"
    | "CANNOT_EDIT_OTHER_USER_MESSAGE"
    | "CANNOT_SEND_MESSAGES_IN_NON_TEXT_CHANNEL" | "CONTENT_BLOCKED"
    | "DIRECT_MESSAGES_DISABLED" | "EXPLICIT_CONTENT_CANNOT_BE_SENT"
    | "FILE_SIZE_TOO_LARGE" | "FEATURE_TEMPORARILY_DISABLED"
    | "SLOWMODE_RATE_LIMITED" | "GUILD_VERIFICATION_REQUIRED"
    | "GUILD_EMAIL_VERIFICATION_REQUIRED" | "TWO_FACTOR_REQUIRED"
    | "BOT_ALREADY_IN_GUILD" | "BOT_IS_PRIVATE"
    | "NOT_A_BOT_APPLICATION" | "APPLICATION_NOT_OWNED"
    | "RESOURCE_LOCKED" | "ACCESS_DENIED" | "BAD_REQUEST"
    | "CONFLICT" | "FORBIDDEN" | "NOT_FOUND" | "RATE_LIMITED"
    | "SERVICE_UNAVAILABLE" | "UNAUTHORIZED" | "INVALID_TOKEN"
    | "MISSING_AUTHORIZATION" | "GONE" | "BAD_GATEWAY"
    | "GATEWAY_TIMEOUT" | "INTERNAL_SERVER_ERROR"
    | "NOT_IMPLEMENTED" | "CANNOT_EXECUTE_ON_DM"
    | "INVITES_DISABLED" | "FEATURE_NOT_AVAILABLE_SELF_HOSTED"
    | "MAX_ACTIVE_THREADS" | "MAX_CATEGORY_CHANNELS" | "MAX_EMOJIS"
    | "MAX_FORUM_TAGS" | "MAX_GUILD_CHANNELS" | "MAX_GUILD_MEMBERS"
    | "MAX_GUILD_ROLES" | "MAX_INVITES"
    | "MAX_PINNED_THREADS_IN_FORUM" | "MAX_REACTIONS"
    | "MAX_STICKERS" | "MAX_THREAD_MEMBERS"
    | "MAX_WEBHOOKS_PER_CHANNEL" | "MAX_WEBHOOKS_PER_GUILD"type ApiProviderCode =
    | "MISSING_ACCESS"
    | "MISSING_PERMISSIONS"
    | "COMMUNICATION_DISABLED"
    | "CANNOT_SEND_MESSAGES_TO_USER"
    | "CANNOT_SEND_EMPTY_MESSAGE"
    | "CANNOT_MODIFY_SYSTEM_WEBHOOK"
    | "ANNOUNCEMENT_CHANNEL_REQUIRED"
    | "CHANNEL_ALREADY_FOLLOWED"
    | "CHANNEL_HAS_FOLLOWED_CHANNELS"
    | "CHANNEL_TYPE_CONVERSION_NOT_SUPPORTED"
    | "FOLLOW_TARGET_CONTENT_WARNING_REQUIRED"
    | "FOLLOW_TARGET_NOT_AGE_RESTRICTED"
    | "INVALID_FOLLOW_TARGET_CHANNEL"
    | "MESSAGE_ALREADY_CROSSPOSTED"
    | "MESSAGE_NOT_CROSSPOSTABLE"
    | "MESSAGE_CROSSPOST_RATE_LIMITED"
    | "PUBLISHED_MESSAGE_EDIT_RATE_LIMITED"
    | "INVALID_CHANNEL_TYPE"
    | "CHANNEL_HAS_THREADS"
    | "THREAD_ALREADY_CREATED_FOR_MESSAGE"
    | "THREAD_ARCHIVED"
    | "THREAD_LOCKED"
    | "FORUM_TAG_NAMES_MUST_BE_UNIQUE"
    | "FORUM_TAG_REQUIRED"
    | "NO_TAGS_AVAILABLE_TO_NON_MODERATORS"
    | "HIDE_MEDIA_DOWNLOAD_OPTION_MEDIA_ONLY"
    | "WEBHOOK_FORUM_TARGET_REQUIRED"
    | "WEBHOOK_THREAD_NAME_REQUIRES_FORUM"
    | "CAPTCHA_REQUIRED"
    | "INVALID_CAPTCHA"
    | "INVALID_FORM_BODY"
    | "VALIDATION_ERROR"
    | "UNKNOWN_APPLICATION"
    | "UNKNOWN_CHANNEL"
    | "UNKNOWN_EMOJI"
    | "UNKNOWN_FORUM_TAG"
    | "UNKNOWN_GUILD"
    | "UNKNOWN_INVITE"
    | "UNKNOWN_MEMBER"
    | "UNKNOWN_MESSAGE"
    | "UNKNOWN_ROLE"
    | "UNKNOWN_STICKER"
    | "UNKNOWN_THREAD_MEMBER"
    | "UNKNOWN_USER"
    | "UNKNOWN_WEBHOOK"
    | "MISSING_OAUTH_SCOPE"
    | "CANNOT_EDIT_OTHER_USER_MESSAGE"
    | "CANNOT_SEND_MESSAGES_IN_NON_TEXT_CHANNEL"
    | "CONTENT_BLOCKED"
    | "DIRECT_MESSAGES_DISABLED"
    | "EXPLICIT_CONTENT_CANNOT_BE_SENT"
    | "FILE_SIZE_TOO_LARGE"
    | "FEATURE_TEMPORARILY_DISABLED"
    | "SLOWMODE_RATE_LIMITED"
    | "GUILD_VERIFICATION_REQUIRED"
    | "GUILD_EMAIL_VERIFICATION_REQUIRED"
    | "TWO_FACTOR_REQUIRED"
    | "BOT_ALREADY_IN_GUILD"
    | "BOT_IS_PRIVATE"
    | "NOT_A_BOT_APPLICATION"
    | "APPLICATION_NOT_OWNED"
    | "RESOURCE_LOCKED"
    | "ACCESS_DENIED"
    | "BAD_REQUEST" | "CONFLICT"
    | "FORBIDDEN" | "NOT_FOUND"
    | "RATE_LIMITED"
    | "SERVICE_UNAVAILABLE"
    | "UNAUTHORIZED"
    | "INVALID_TOKEN"
    | "MISSING_AUTHORIZATION"
    | "GONE" | "BAD_GATEWAY"
    | "GATEWAY_TIMEOUT"
    | "INTERNAL_SERVER_ERROR"
    | "NOT_IMPLEMENTED"
    | "CANNOT_EXECUTE_ON_DM"
    | "INVITES_DISABLED"
    | "FEATURE_NOT_AVAILABLE_SELF_HOSTED"
    | "MAX_ACTIVE_THREADS"
    | "MAX_CATEGORY_CHANNELS"
    | "MAX_EMOJIS"
    | "MAX_FORUM_TAGS"
    | "MAX_GUILD_CHANNELS"
    | "MAX_GUILD_MEMBERS"
    | "MAX_GUILD_ROLES"
    | "MAX_INVITES"
    | "MAX_PINNED_THREADS_IN_FORUM"
    | "MAX_REACTIONS"
    | "MAX_STICKERS"
    | "MAX_THREAD_MEMBERS"
    | "MAX_WEBHOOKS_PER_CHANNEL"
    | "MAX_WEBHOOKS_PER_GUILD"

ApiValidationCode#

Exact Fluxer validation code that the SDK recognizes, read from ApiValidationErrorDetail.providerCode

An unrecognized validation code stays in validationErrors with a generic explanation when it has a safe code shape

type ApiValidationCode =
    | "ATTACHMENTS_NOT_ALLOWED_FOR_MESSAGE"
    | "CANNOT_DELETE_MORE_THAN_100_MESSAGES"
    | "CANNOT_SEND_EMPTY_MESSAGE"
    | "CANNOT_SPECIFY_BOTH_BEFORE_AND_AFTER"
    | "CONTENT_EXCEEDS_MAX_LENGTH"
    | "DUPLICATE_ATTACHMENT_IDS_NOT_ALLOWED"
    | "DUPLICATE_FILE_INDEX" | "EMBEDS_EXCEED_MAX_CHARACTERS"
    | "FILE_INDEX_EXCEEDS_MAXIMUM" | "INVALID_AUDIT_LOG_REASON"
    | "INVALID_FORMAT" | "INVALID_MESSAGE_DATA"
    | "INVALID_SNOWFLAKE" | "INVALID_SNOWFLAKE_FORMAT"
    | "INVALID_URL_FORMAT" | "MESSAGE_IDS_CANNOT_BE_EMPTY"
    | "STRING_LENGTH_INVALID" | "TOO_MANY_EMBEDS" | "TOO_MANY_FILES"
    | "TOO_LARGE" | "ATTACHMENT_FIELDS_REQUIRED"
    | "INVALID_TIMEOUT_VALUE" | "TIMEOUT_CANNOT_EXCEED_365_DAYS"
    | "RECIPIENT_IDS_CANNOT_BE_EMPTY"
    | "DUPLICATE_RECIPIENTS_NOT_ALLOWED"
    | "VANITY_URL_CODE_ALREADY_TAKEN"
    | "VANITY_URL_CODE_LENGTH_INVALID"
    | "VANITY_URL_INVALID_CHARACTERS"type ApiValidationCode =
    | "ATTACHMENTS_NOT_ALLOWED_FOR_MESSAGE"
    | "CANNOT_DELETE_MORE_THAN_100_MESSAGES"
    | "CANNOT_SEND_EMPTY_MESSAGE"
    | "CANNOT_SPECIFY_BOTH_BEFORE_AND_AFTER"
    | "CONTENT_EXCEEDS_MAX_LENGTH"
    | "DUPLICATE_ATTACHMENT_IDS_NOT_ALLOWED"
    | "DUPLICATE_FILE_INDEX"
    | "EMBEDS_EXCEED_MAX_CHARACTERS"
    | "FILE_INDEX_EXCEEDS_MAXIMUM"
    | "INVALID_AUDIT_LOG_REASON"
    | "INVALID_FORMAT"
    | "INVALID_MESSAGE_DATA"
    | "INVALID_SNOWFLAKE"
    | "INVALID_SNOWFLAKE_FORMAT"
    | "INVALID_URL_FORMAT"
    | "MESSAGE_IDS_CANNOT_BE_EMPTY"
    | "STRING_LENGTH_INVALID"
    | "TOO_MANY_EMBEDS"
    | "TOO_MANY_FILES"
    | "TOO_LARGE"
    | "ATTACHMENT_FIELDS_REQUIRED"
    | "INVALID_TIMEOUT_VALUE"
    | "TIMEOUT_CANNOT_EXCEED_365_DAYS"
    | "RECIPIENT_IDS_CANNOT_BE_EMPTY"
    | "DUPLICATE_RECIPIENTS_NOT_ALLOWED"
    | "VANITY_URL_CODE_ALREADY_TAKEN"
    | "VANITY_URL_CODE_LENGTH_INVALID"
    | "VANITY_URL_INVALID_CHARACTERS"

AttachmentRefreshOperation#

Attachment URL refresh operation identified by safe failure metadata

type AttachmentRefreshOperation = "attachments.refreshUrls"type AttachmentRefreshOperation =
    "attachments.refreshUrls"

BotApplicationOperation#

Operation name included in application-read failures

type BotApplicationOperation = "application.fetch"type BotApplicationOperation =
    "application.fetch"

ChannelOperation#

The channel or thread action named in an expected failure or SdkDefect

type ChannelOperation =
    | "channels.get" | "channels.fetch" | "channels.fetchAll"
    | "channels.follow" | "channels.fetchFollowerStats"
    | "channels.create" | "channels.edit" | "channels.delete"
    | "channels.reorder" | "channels.setPermissionOverwrite"
    | "channels.removePermissionOverwrite"
    | "channels.createForumTag" | "channels.editForumTag"
    | "channels.deleteForumTag" | "threads.create"
    | "threads.createFromMessage" | "threads.createPost"
    | "threads.edit" | "threads.fetchActive"
    | "threads.fetchArchived" | "threads.search" | "threads.join"
    | "threads.leave" | "threads.addMember" | "threads.removeMember"
    | "threads.fetchMember" | "threads.fetchMembers"type ChannelOperation =
    | "channels.get"
    | "channels.fetch"
    | "channels.fetchAll"
    | "channels.follow"
    | "channels.fetchFollowerStats"
    | "channels.create"
    | "channels.edit"
    | "channels.delete"
    | "channels.reorder"
    | "channels.setPermissionOverwrite"
    | "channels.removePermissionOverwrite"
    | "channels.createForumTag"
    | "channels.editForumTag"
    | "channels.deleteForumTag"
    | "threads.create"
    | "threads.createFromMessage"
    | "threads.createPost"
    | "threads.edit"
    | "threads.fetchActive"
    | "threads.fetchArchived"
    | "threads.search"
    | "threads.join"
    | "threads.leave"
    | "threads.addMember"
    | "threads.removeMember"
    | "threads.fetchMember"
    | "threads.fetchMembers"

CountOperation#

The guild or channel count request named in an error

One call can send commands to several local shards but occupies one shared request slot and does not cache counts

type CountOperation =
    "guilds.fetchCounts" | "channels.fetchMemberCounts"type CountOperation =
    | "guilds.fetchCounts"
    | "channels.fetchMemberCounts"

DefectReason#

Details of what caused an SdkDefect in the default API

Failure holds an expected SDK error, Defect holds an unexpected fault with its original value, and Interruption marks cancellation. More than one entry can describe both the original failure and a cleanup fault. Effect reports an expected failure that occurs together with a fault as a fault too, so that failure appears as a Defect entry holding the expected SDK error

type DefectReason =
    | {
          readonly failure:
              | ConnectError | ConfigurationError | EventReadError
              | EventWaitError | MessageError
              | MessageOperationError | MessageCleanupError
              | GuildOperationError | ChannelOperationError
              | WebhookOperationError | UserOperationError
              | BotApplicationOperationError | OAuthOperationError
              | CountOperationError | MemberChunkError
              | PresenceError | PaginationError | CollectorError
              | AttachmentDownloadFailure | AttachmentRefreshFailure
              | SupervisorError | SupervisorChildError
              | CancelledError | CriticalWorkerStoppedError
          readonly kind: "Failure"
      }
    | {
          readonly defect: unknown
          readonly kind: "Defect"
          readonly origin: "application" | "sdk"
      }
    | { readonly kind: "Interruption" }type DefectReason =
    | {
        readonly failure:
          | ConnectError
          | ConfigurationError
          | EventReadError
          | EventWaitError
          | MessageError
          | MessageOperationError
          | MessageCleanupError
          | GuildOperationError
          | ChannelOperationError
          | WebhookOperationError
          | UserOperationError
          | BotApplicationOperationError
          | OAuthOperationError
          | CountOperationError
          | MemberChunkError
          | PresenceError
          | PaginationError
          | CollectorError
          | AttachmentDownloadFailure
          | AttachmentRefreshFailure
          | SupervisorError
          | SupervisorChildError
          | CancelledError
          | CriticalWorkerStoppedError
        readonly kind: "Failure"
      }
    | {
        readonly defect: unknown
        readonly kind: "Defect"
        readonly origin:
          | "application" | "sdk"
      }
    | {
        readonly kind:
          "Interruption"
      }

ErrorMatchHandlers#

Handlers for errors.match, keyed by each possible error's _tag, plus an optional _ fallback

type ErrorMatchHandlers<E, R> =
    & {
          readonly [K in E extends { readonly _tag: string }
              ? E["_tag"]
              : never]?:
              (error: Extract<E, { readonly _tag: K }>) => R
      }
    & { readonly _?: (error: unknown) => R }type ErrorMatchHandlers<E, R> =
    & {
        readonly [K in E extends {
          readonly _tag: string
        }
          ? E["_tag"]
          : never]?:
          (
            error: Extract<
              E,
              { readonly _tag: K }
            >
          ) => R
      }
    & {
        readonly _?: (
          error: unknown
        ) => R
      }

GuildOperation#

The guild or related-resource action named in an expected failure or SdkDefect

type GuildOperation =
    | "permissions.calculate"
    | "permissions.fetch"
    | "permissions.fetchChannels"
    | `hierarchy.${
          | "compare" | "isAbove" | "canManage" | "highestRole"
          | "canManageRole"}`
    | "members.search"
    | `discovery.${
          | "search" | "fetchStatus" | "fetchCategories" | "apply"
          | "edit" | "withdraw"}`
    | `invites.${
          | "fetch" | "create" | "fetchForChannel" | "fetchForGuild"
          | "delete"}`
    | `${"emojis" | "stickers"}.${
          | "get" | "fetchAll" | "fetchMetadata" | "fetchSource"
          | "create" | "createMany" | "clone" | "edit" | "delete"}`
    | "guilds.get"
    | "guilds.edit"
    | "guilds.fetchVanityUrl"
    | "guilds.editVanityUrl"
    | "auditLogs.fetchPage"
    | "members.get"
    | "members.getSelf"
    | "roles.get"
    | "roles.getAll"
    | "guilds.fetch"
    | "guilds.fetchPage"
    | "guilds.leave"
    | "guilds.deleteOwnMessages"
    | "members.ban"
    | "members.unban"
    | "members.fetchBans"
    | "members.timeout"
    | "members.clearTimeout"
    | "members.timeoutState"
    | "members.kick"
    | "members.fetch"
    | "members.fetchSelf"
    | "members.fetchCanManage"
    | "members.fetchPage"
    | "members.editSelf"
    | "members.setNickname"
    | "members.move"
    | "members.disconnect"
    | "members.setMute"
    | "members.setDeaf"
    | "members.setRoles"
    | "members.addRole"
    | "members.removeRole"
    | "roles.fetchAll"
    | "roles.create"
    | "roles.edit"
    | "roles.delete"
    | "roles.reorder"
    | "roles.setHoistPositions"
    | "roles.resetHoistPositions"type GuildOperation =
    | "permissions.calculate"
    | "permissions.fetch"
    | "permissions.fetchChannels"
    | `hierarchy.${
        | "compare" | "isAbove"
        | "canManage"
        | "highestRole"
        | "canManageRole"}`
    | "members.search"
    | `discovery.${
        | "search" | "fetchStatus"
        | "fetchCategories"
        | "apply" | "edit"
        | "withdraw"}`
    | `invites.${
        | "fetch" | "create"
        | "fetchForChannel"
        | "fetchForGuild"
        | "delete"}`
    | `${"emojis" | "stickers"}.${
        | "get" | "fetchAll"
        | "fetchMetadata"
        | "fetchSource" | "create"
        | "createMany" | "clone"
        | "edit" | "delete"}`
    | "guilds.get"
    | "guilds.edit"
    | "guilds.fetchVanityUrl"
    | "guilds.editVanityUrl"
    | "auditLogs.fetchPage"
    | "members.get"
    | "members.getSelf"
    | "roles.get"
    | "roles.getAll"
    | "guilds.fetch"
    | "guilds.fetchPage"
    | "guilds.leave"
    | "guilds.deleteOwnMessages"
    | "members.ban"
    | "members.unban"
    | "members.fetchBans"
    | "members.timeout"
    | "members.clearTimeout"
    | "members.timeoutState"
    | "members.kick"
    | "members.fetch"
    | "members.fetchSelf"
    | "members.fetchCanManage"
    | "members.fetchPage"
    | "members.editSelf"
    | "members.setNickname"
    | "members.move"
    | "members.disconnect"
    | "members.setMute"
    | "members.setDeaf"
    | "members.setRoles"
    | "members.addRole"
    | "members.removeRole"
    | "roles.fetchAll"
    | "roles.create"
    | "roles.edit"
    | "roles.delete"
    | "roles.reorder"
    | "roles.setHoistPositions"
    | "roles.resetHoistPositions"

InputValidationConstraint#

Identifies why the SDK rejected an input before sending a request

The rule may concern its type, allowed range, format or relationship to another field. These categories do not describe Fluxer errors and are not ready-made messages for users

type InputValidationConstraint =
    | "required" | "type" | "format" | "range" | "length"
    | "allowedValue" | "allowedFields" | "relationship" | "unique"
    | "size"type InputValidationConstraint =
    | "required" | "type"
    | "format" | "range" | "length"
    | "allowedValue"
    | "allowedFields"
    | "relationship" | "unique"
    | "size"

InstanceResolveError#

Expected instance-resolution failures, including invalid options, connection trouble, deadline expiry, rate limits and client closure

Default API calls add CancelledError, while native interruption remains in the Effect cause

type InstanceResolveError =
    | ConnectionError | ConnectionTimeoutError | RateLimitError
    | ClientClosedError | ConfigurationErrortype InstanceResolveError =
    | ConnectionError
    | ConnectionTimeoutError
    | RateLimitError
    | ClientClosedError
    | ConfigurationError

MessageCleanupErrorReason#

Expected preview or cleanup failure classification

The reason filter denotes a bad selection callback, closed denotes client closure, which keeps the outcome of the step it ended, and input denotes invalid settings or plan ownership. Other values preserve the underlying message operation's failure reason

type MessageCleanupErrorReason =
    "filter" | "closed" | "input" | MessageOperationError["reason"]type MessageCleanupErrorReason =
    | "filter"
    | "closed"
    | "input"
    | MessageOperationError["reason"]

NotFoundResource#

Resources that Fluxer reports as missing, accepted by errors.isNotFound

A thread is a channel

type NotFoundResource =
    | "application" | "channel" | "emoji" | "forumTag" | "guild"
    | "invite" | "member" | "message" | "role" | "sticker"
    | "threadMember" | "user" | "webhook"type NotFoundResource =
    | "application" | "channel"
    | "emoji" | "forumTag"
    | "guild" | "invite" | "member"
    | "message" | "role"
    | "sticker" | "threadMember"
    | "user" | "webhook"

OAuthOperation#

Public OAuth call identified by operation-error metadata

type OAuthOperation =
    | "oauth.authorizationUrl" | "oauth.exchangeCode"
    | "oauth.refresh" | "oauth.revoke" | "oauth.fetchIdentity"
    | "oauth.fetchGuilds" | "oauth.fetchConnections"
    | "oauth.introspect"type OAuthOperation =
    | "oauth.authorizationUrl"
    | "oauth.exchangeCode"
    | "oauth.refresh"
    | "oauth.revoke"
    | "oauth.fetchIdentity"
    | "oauth.fetchGuilds"
    | "oauth.fetchConnections"
    | "oauth.introspect"

Operation#

Identifies the default API call during which an SdkDefect was observed

This attribution does not establish whether a dispatched server mutation took effect or was rolled back

type Operation =
    | "attachments.download" | "attachments.stream"
    | AttachmentRefreshOperation | "instance.resolve"
    | "presence.set" | "presence.setMembers" | "cache.entries"
    | "users.getSelf" | "directMessages.send"
    | BotApplicationOperation | "oauth.create" | OAuthOperation
    | CountOperation | "members.iterateChunks" | UserOperation
    | WebhookOperation | "createWebhookClient" | ChannelOperation
    | GuildOperation | RestOperation | "gateway.send"
    | "logging.configure" | "cache.onChange" | PaginationOperation
    | "createClient" | "supervisor.create" | "supervisor.start"
    | "supervisor.waitForClose" | "supervisor.waitForReady"
    | "supervisor.shutdown" | "supervisor.child.run" | "commands"
    | "connect" | "run" | "runBot" | "waitForClose" | "waitFor"
    | "shutdown" | "on" | "subscribe" | "schedule" | "next" | "send"
    | "forward" | "reply" | "typing" | "keepTyping" | "fetch"
    | "publish" | "fetchCrosspostSource" | "messages.get"
    | "fetchHistory" | "previewCleanup" | "search"
    | "fetchReactionUsers" | "fetchHasReaction" | "pin" | "unpin"
    | "fetchPins" | "addReaction" | "removeReaction"
    | "removeUserReaction" | "clearReaction" | "clearReactions"
    | "edit" | "delete" | "deleteAttachment" | "deleteMany"
    | "deleteOwnMessages" | "cleanup" | "subscription.waitForClose"
    | "collect" | "collector.result" | "collectReactions"
    | "reactionCollector.result" | "paginate"type Operation =
    | "attachments.download"
    | "attachments.stream"
    | AttachmentRefreshOperation
    | "instance.resolve"
    | "presence.set"
    | "presence.setMembers"
    | "cache.entries"
    | "users.getSelf"
    | "directMessages.send"
    | BotApplicationOperation
    | "oauth.create"
    | OAuthOperation
    | CountOperation
    | "members.iterateChunks"
    | UserOperation
    | WebhookOperation
    | "createWebhookClient"
    | ChannelOperation
    | GuildOperation
    | RestOperation
    | "gateway.send"
    | "logging.configure"
    | "cache.onChange"
    | PaginationOperation
    | "createClient"
    | "supervisor.create"
    | "supervisor.start"
    | "supervisor.waitForClose"
    | "supervisor.waitForReady"
    | "supervisor.shutdown"
    | "supervisor.child.run"
    | "commands" | "connect"
    | "run" | "runBot"
    | "waitForClose" | "waitFor"
    | "shutdown" | "on"
    | "subscribe" | "schedule"
    | "next" | "send" | "forward"
    | "reply" | "typing"
    | "keepTyping" | "fetch"
    | "publish"
    | "fetchCrosspostSource"
    | "messages.get"
    | "fetchHistory"
    | "previewCleanup" | "search"
    | "fetchReactionUsers"
    | "fetchHasReaction" | "pin"
    | "unpin" | "fetchPins"
    | "addReaction"
    | "removeReaction"
    | "removeUserReaction"
    | "clearReaction"
    | "clearReactions" | "edit"
    | "delete" | "deleteAttachment"
    | "deleteMany"
    | "deleteOwnMessages"
    | "cleanup"
    | "subscription.waitForClose"
    | "collect"
    | "collector.result"
    | "collectReactions"
    | "reactionCollector.result"
    | "paginate"

OperationOutcome#

Whether a request may have reached Fluxer

The outcome notDispatched means it was not sent, rejected means Fluxer refused it, and unknown means the result is uncertain. A write with an unknown outcome may already have applied, so reconcile remote state before repeating it. A read with an unknown outcome cannot have changed remote state and is safe to repeat. A rejection does not prove rollback

type OperationOutcome = "notDispatched" | "rejected" | "unknown"type OperationOutcome =
    | "notDispatched" | "rejected"
    | "unknown"

OperationReason#

Why a remote operation failed

The reason input means local validation failed, busy means local request capacity was full, and notFound means HTTP 404. A 404 does not prove that an earlier deletion succeeded. The reason rejected is another API rejection, network is a transport failure, response means unusable success data, timeout means the deadline expired, and rateLimit means the wait Fluxer required could not be completed. A connection lost while a response body arrives is a network failure. HTTP failures keep their status, never their response bodies

type OperationReason =
    | "input" | "busy" | "notFound" | "rejected" | "network"
    | "response" | "timeout" | "rateLimit"type OperationReason =
    | "input" | "busy" | "notFound"
    | "rejected" | "network"
    | "response" | "timeout"
    | "rateLimit"

PaginateFailure#

Expected reaction page failures: Invalid pages or options, a failed send, a failed page change, arrow or click removal, an unavailable or lost gateway, an overflowing listener or a failing users check

After the first page is sent, the message stays at its current page and the bot still removes its own arrows. When that removal also fails, the earlier failure is returned. After an otherwise normal end, the removal failure is returned

type PaginateFailure =
    | ConfigurationError | SendError | MessageOperationFailure
    | CollectorFailuretype PaginateFailure =
    | ConfigurationError
    | SendError
    | MessageOperationFailure
    | CollectorFailure

PaginationOperation#

Operation name included in a PaginationError or default-API SDK defect to identify the traversal

type PaginationOperation =
    | "iterateHistory" | "messages.iterateSearch"
    | "members.iterate" | "guilds.iterate" | "members.iterateSearch"
    | "iterateReactionUsers" | "iteratePins" | "auditLogs.iterate"
    | "threads.iterateMembers"type PaginationOperation =
    | "iterateHistory"
    | "messages.iterateSearch"
    | "members.iterate"
    | "guilds.iterate"
    | "members.iterateSearch"
    | "iterateReactionUsers"
    | "iteratePins"
    | "auditLogs.iterate"
    | "threads.iterateMembers"

RestOperation#

Operation name included in REST request failures

type RestOperation = "rest.request"

UserOperation#

User/private-conversation operation named by safe failure metadata

type UserOperation =
    | "users.fetch" | "users.fetchSelf" | "users.fetchProfile"
    | "users.get" | "directMessages.open" | "directMessages.fetch"
    | "directMessages.fetchAll"
    | "directMessages.fetchLatestMessages" | "directMessages.get"
    | "directMessages.editGroup" | "directMessages.close"
    | "directMessages.removeRecipient"type UserOperation =
    | "users.fetch"
    | "users.fetchSelf"
    | "users.fetchProfile"
    | "users.get"
    | "directMessages.open"
    | "directMessages.fetch"
    | "directMessages.fetchAll"
    | "directMessages.fetchLatestMessages"
    | "directMessages.get"
    | "directMessages.editGroup"
    | "directMessages.close"
    | "directMessages.removeRecipient"

WebhookOperation#

Identifies the webhook action that failed, so an error can be associated with the request the application made

type WebhookOperation =
    | "webhooks.create" | "webhooks.fetch"
    | "webhooks.fetchForChannel" | "webhooks.fetchForGuild"
    | "webhooks.edit" | "webhooks.delete" | "webhooks.fetchToken"
    | "webhooks.editToken" | "webhooks.deleteToken"
    | "webhooks.send" | "webhooks.fetchMessage"
    | "webhooks.editMessage" | "webhooks.deleteMessage"type WebhookOperation =
    | "webhooks.create"
    | "webhooks.fetch"
    | "webhooks.fetchForChannel"
    | "webhooks.fetchForGuild"
    | "webhooks.edit"
    | "webhooks.delete"
    | "webhooks.fetchToken"
    | "webhooks.editToken"
    | "webhooks.deleteToken"
    | "webhooks.send"
    | "webhooks.fetchMessage"
    | "webhooks.editMessage"
    | "webhooks.deleteMessage"