Class in Errors · JavaScript & TypeScript
A helper could not use its input
class HelperError extends FluxerlyErrorclass HelperError
extends FluxerlyErrorHelpers such as format.userMention throw this for invalid input, because passing it is a programming mistake. The try-prefixed helpers, such as format, report the same error without throwing. The default API returns it in a Result, while the native API fails with it in the Effect error channel. Read operation and reason to identify the problem. The error does not store the rejected value
Constructor#
new HelperError(
operation:
| "format.userMention" | "format.roleMention"
| "format.channelMention" | "format.parseMention"
| "format.timestamp" | "format.parseTimestamp"
| "format.customEmoji" | "format.parseCustomEmoji"
| "snowflakes.parse" | "snowflakes.createdAt"
| "snowflakes.boundary" | "snowflakes.shardFor"
| "permissionBits.has" | "permissionBits.from"
| "permissionBits.hasAll" | "permissionBits.hasAny"
| "permissionBits.missing" | "permissionBits.inspect"
| "permissionBits.toDecimal" | "permissionBits.label"
| "permissionBits.patchOverwrite"
| "permissionBits.refusedGrants"
| "permissionBits.sameOverwrites" | "colors.parse"
| "colors.toHex" | "colors.toRgb" | "text.split"
| "text.truncate" | "errors.isNotFound" | "links.channel"
| "links.message" | "links.installation" | "embed.color"
| "embed.timestamp" | "voiceWaveform",
reason:
| "link" | "time" | "id" | "color" | "audio" | "text"
| "limit" | "markup" | "permissionBits" | "shardCount"
| "resource",
options?: { readonly cause?: unknown }
): HelperErrornew HelperError(
operation:
| "format.userMention"
| "format.roleMention"
| "format.channelMention"
| "format.parseMention"
| "format.timestamp"
| "format.parseTimestamp"
| "format.customEmoji"
| "format.parseCustomEmoji"
| "snowflakes.parse"
| "snowflakes.createdAt"
| "snowflakes.boundary"
| "snowflakes.shardFor"
| "permissionBits.has"
| "permissionBits.from"
| "permissionBits.hasAll"
| "permissionBits.hasAny"
| "permissionBits.missing"
| "permissionBits.inspect"
| "permissionBits.toDecimal"
| "permissionBits.label"
| "permissionBits.patchOverwrite"
| "permissionBits.refusedGrants"
| "permissionBits.sameOverwrites"
| "colors.parse"
| "colors.toHex"
| "colors.toRgb" | "text.split"
| "text.truncate"
| "errors.isNotFound"
| "links.channel"
| "links.message"
| "links.installation"
| "embed.color"
| "embed.timestamp"
| "voiceWaveform",
reason:
| "link" | "time" | "id"
| "color" | "audio" | "text"
| "limit" | "markup"
| "permissionBits"
| "shardCount" | "resource",
options?: {
readonly cause?: unknown
}
): HelperErrorParameters
operation-
Helper that rejected the input
| "format.userMention" | "format.roleMention" | "format.channelMention" | "format.parseMention" | "format.timestamp" | "format.parseTimestamp" | "format.customEmoji" | "format.parseCustomEmoji" | "snowflakes.parse" | "snowflakes.createdAt" | "snowflakes.boundary" | "snowflakes.shardFor" | "permissionBits.has" | "permissionBits.from" | "permissionBits.hasAll" | "permissionBits.hasAny" | "permissionBits.missing" | "permissionBits.inspect" | "permissionBits.toDecimal" | "permissionBits.label" | "permissionBits.patchOverwrite" | "permissionBits.refusedGrants" | "permissionBits.sameOverwrites" | "colors.parse" | "colors.toHex" | "colors.toRgb" | "text.split" | "text.truncate" | "errors.isNotFound" | "links.channel" | "links.message" | "links.installation" | "embed.color" | "embed.timestamp" | "voiceWaveform"| "format.userMention" | "format.roleMention" | "format.channelMention" | "format.parseMention" | "format.timestamp" | "format.parseTimestamp" | "format.customEmoji" | "format.parseCustomEmoji" | "snowflakes.parse" | "snowflakes.createdAt" | "snowflakes.boundary" | "snowflakes.shardFor" | "permissionBits.has" | "permissionBits.from" | "permissionBits.hasAll" | "permissionBits.hasAny" | "permissionBits.missing" | "permissionBits.inspect" | "permissionBits.toDecimal" | "permissionBits.label" | "permissionBits.patchOverwrite" | "permissionBits.refusedGrants" | "permissionBits.sameOverwrites" | "colors.parse" | "colors.toHex" | "colors.toRgb" | "text.split" | "text.truncate" | "errors.isNotFound" | "links.channel" | "links.message" | "links.installation" | "embed.color" | "embed.timestamp" | "voiceWaveform" reason-
Invalid input category, without retaining the rejected value
| "link" | "time" | "id" | "color" | "audio" | "text" | "limit" | "markup" | "permissionBits" | "shardCount" | "resource"| "link" | "time" | "id" | "color" | "audio" | "text" | "limit" | "markup" | "permissionBits" | "shardCount" | "resource" optionsoptional-
Optional underlying failure retained as the error's cause
{ readonly cause?: unknown }
Properties#
_tag#
Fixed name that identifies this error type
readonly _tag: "HelperError"operation#
Helper that rejected the input
readonly operation:
| "format.userMention" | "format.roleMention"
| "format.channelMention" | "format.parseMention"
| "format.timestamp" | "format.parseTimestamp"
| "format.customEmoji" | "format.parseCustomEmoji"
| "snowflakes.parse" | "snowflakes.createdAt"
| "snowflakes.boundary" | "snowflakes.shardFor"
| "permissionBits.has" | "permissionBits.from"
| "permissionBits.hasAll" | "permissionBits.hasAny"
| "permissionBits.missing" | "permissionBits.inspect"
| "permissionBits.toDecimal" | "permissionBits.label"
| "permissionBits.patchOverwrite"
| "permissionBits.refusedGrants"
| "permissionBits.sameOverwrites" | "colors.parse"
| "colors.toHex" | "colors.toRgb" | "text.split"
| "text.truncate" | "errors.isNotFound" | "links.channel"
| "links.message" | "links.installation" | "embed.color"
| "embed.timestamp" | "voiceWaveform"readonly operation:
| "format.userMention"
| "format.roleMention"
| "format.channelMention"
| "format.parseMention"
| "format.timestamp"
| "format.parseTimestamp"
| "format.customEmoji"
| "format.parseCustomEmoji"
| "snowflakes.parse"
| "snowflakes.createdAt"
| "snowflakes.boundary"
| "snowflakes.shardFor"
| "permissionBits.has"
| "permissionBits.from"
| "permissionBits.hasAll"
| "permissionBits.hasAny"
| "permissionBits.missing"
| "permissionBits.inspect"
| "permissionBits.toDecimal"
| "permissionBits.label"
| "permissionBits.patchOverwrite"
| "permissionBits.refusedGrants"
| "permissionBits.sameOverwrites"
| "colors.parse" | "colors.toHex"
| "colors.toRgb" | "text.split"
| "text.truncate"
| "errors.isNotFound"
| "links.channel"
| "links.message"
| "links.installation"
| "embed.color"
| "embed.timestamp"
| "voiceWaveform"reason#
Invalid input category, without retaining the rejected value
readonly reason:
| "link" | "time" | "id" | "color" | "audio" | "text" | "limit"
| "markup" | "permissionBits" | "shardCount" | "resource"readonly reason:
| "link" | "time" | "id"
| "color" | "audio" | "text"
| "limit" | "markup"
| "permissionBits" | "shardCount"
| "resource"Inherited#
Inherited from Fluxerly: code, details, hint, to