class Discordrb::Errors::CodeError

Generic class for errors denoted by API error codes

Attributes

code[R]

@return [Integer] The error code represented by this error class.

message[R]

@return [String] This error's represented message

Public Class Methods

new(message) click to toggle source

Create a new error with a particular message (the code should be defined by the class instance variable) @param message [String] the message to use

# File lib/discordrb/errors.rb, line 32
def initialize(message)
  @message = message
end

Public Instance Methods

code() click to toggle source

@return [Integer] The error code represented by this error.

# File lib/discordrb/errors.rb, line 37
def code
  self.class.code
end