NAME

Discord::Client::Error - SDK failure details

SYNOPSIS

# Inspect a failed SDK Future without logging credentials.
my ($message, $category, $error) = $future->failure;
my $status = $error->status;
my $code = $error->discord_code;

DESCRIPTION

Failure details for SDK Futures and error callbacks. Stringification returns message. SDK-produced messages omit credentials, raw bodies and exceptions. Unavailable fields return undef. HTTP status and Discord error code are separate.

METHODS

new

new(message => ..., category => ..., field_pairs) returns an Error. It stores supplied fields without validation or sanitization; the SDK sanitizes its own errors before construction.

message

Returns the error message.

category

Returns the failure category, such as request, handler or shutdown. REST categories are described in "ERRORS AND CANCELLATION" in Discord::Client::REST.

status

Returns the HTTP status code or undef.

discord_code

Returns the Discord error code or undef.

request_id

Returns the request ID or undef.

details

Returns additional error details or undef.

close_code

Returns the Gateway close code or undef.

event

Returns the event associated with the error or undef.

LICENSE

Apache License 2.0.