DiscordLua
discorddiscord
v1.2.4
Install

AuthenticationError

Error
On this page

AuthenticationError is raised or passed to a REST callback when an operation fails. Read name and message; REST errors may also expose HTTP status and Discord error codes.

error Module 1.2.4 Source

Constructor

AuthenticationError.new(message, extra)

The class table is callable, so AuthenticationError(message, extra) is the same as .new.

NameTypeRequiredBehavior
message any required Passed through to the implementation as written.
extra any optional Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.AuthenticationError({}, {})

Properties

AuthenticationError.code

# readonly
Name
code
Type
number
Access
readonly
Description
Instance field AuthenticationError.code. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this AuthenticationError.

AuthenticationError.extra

# readonly
Name
extra
Type
table
Access
readonly
Description
Instance field AuthenticationError.extra. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this AuthenticationError.

AuthenticationError.message

# readonly
Name
message
Type
string
Access
readonly
Description
Instance field AuthenticationError.message. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this AuthenticationError.

AuthenticationError.method

# readonly
Name
method
Type
string
Access
readonly
Description
Instance field AuthenticationError.method. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this AuthenticationError.

AuthenticationError.name

# readonly
Name
name
Type
string
Access
readonly
Description
Display name of this AuthenticationError.
Availability
Populated from the Gateway/REST payload or constructor for this AuthenticationError.

AuthenticationError.path

# readonly
Name
path
Type
string
Access
readonly
Description
Instance field AuthenticationError.path. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this AuthenticationError.

AuthenticationError.retryAfter

# readonly
Name
retryAfter
Type
number
Access
readonly
Description
Instance field AuthenticationError.retryAfter. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this AuthenticationError.

AuthenticationError.status

# readonly
Name
status
Type
number
Access
readonly
Description
Instance field AuthenticationError.status. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this AuthenticationError.

Methods

AuthenticationError.new()

# static

Performs new on this AuthenticationError. Call it from bot code when you need that operation on the current object.

Signature

AuthenticationError.new(message, extra)

Parameters

NameTypeRequiredBehavior
message any required Passed through to the implementation as written.
extra any optional Passed through to the implementation as written.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a AuthenticationError
AuthenticationError.new(message, extra)

AuthenticationError:raise()

#

Performs raise on this AuthenticationError. Call it from bot code when you need that operation on the current object.

Signature

AuthenticationError:raise(level)

Parameters

NameTypeRequiredBehavior
level any required Passed through to the implementation as written.

Returns

any.

Throws

A DiscordLua error when arguments are invalid or the request fails without a callback.

Example

lua
local discord = require("discord")
-- object is a AuthenticationError
object:raise(level)

Examples

lua
local discord = require("discord")
local object = discord.AuthenticationError({})

APIError · DiscordLuaError · GatewayError · HTTPError · PermissionError · RateLimitError · RuntimeError · ValidationError

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc