Exception: DiscordStore::APIError

Inherits:
Error
  • Object
show all
Defined in:
lib/discord_store/errors.rb

Overview

Base class for anything that came back from Discord's REST API.

Direct Known Subclasses

AuthError, NotFoundError, RateLimitedError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status: nil, code: nil, response_body: nil) ⇒ APIError

Returns a new instance of APIError.



40
41
42
43
44
45
# File 'lib/discord_store/errors.rb', line 40

def initialize(message, status: nil, code: nil, response_body: nil)
  @status = status
  @code = code
  @response_body = response_body
  super(message)
end

Instance Attribute Details

#code ⇒ Object (readonly)

Returns the value of attribute code.



38
39
40
# File 'lib/discord_store/errors.rb', line 38

def code
  @code
end

#response_body ⇒ Object (readonly)

Returns the value of attribute response_body.



38
39
40
# File 'lib/discord_store/errors.rb', line 38

def response_body
  @response_body
end

#status ⇒ Object (readonly)

Returns the value of attribute status.



38
39
40
# File 'lib/discord_store/errors.rb', line 38

def status
  @status
end