Exception: Discordrb::Errors::CodeError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/discordrb/errors.rb

Overview

Generic class for errors denoted by API error codes

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ CodeError

Create a new error with a particular message (the code should be defined by the class instance variable)


32
33
34
# File 'lib/discordrb/errors.rb', line 32

def initialize(message)
  @message = message
end

Class Attribute Details

.codeInteger (readonly)


27
28
29
# File 'lib/discordrb/errors.rb', line 27

def code
  @code
end

Instance Attribute Details

#messageString (readonly)


42
43
44
# File 'lib/discordrb/errors.rb', line 42

def message
  @message
end

Instance Method Details

#codeInteger


37
38
39
# File 'lib/discordrb/errors.rb', line 37

def code
  self.class.code
end