AuthenticationError
ErrorOn 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.
Constructor
AuthenticationError.new(message, extra) The class table is callable, so AuthenticationError(message, extra) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
message |
any |
required | Passed through to the implementation as written. |
extra |
any |
optional | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.AuthenticationError({}, {})Properties
- 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.
- 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.
- 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.
- 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.
- Name
name- Type
string- Access
- readonly
- Description
- Display name of this AuthenticationError.
- Availability
- Populated from the Gateway/REST payload or constructor for this AuthenticationError.
- 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.
- 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.
- 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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
message |
any |
required | Passed through to the implementation as written. |
extra |
any |
optional | Passed through to the implementation as written. |
Returns
any.
Example
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
local discord = require("discord")
-- object is a AuthenticationError
object:raise(level)Examples
local discord = require("discord")
local object = discord.AuthenticationError({})Related APIs
APIError · DiscordLuaError · GatewayError · HTTPError · PermissionError · RateLimitError · RuntimeError · ValidationError
Version: discord 1.2.4 · runtime 1.0.0