Exception: OnyxCord::Errors::HTTPError

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

Direct Known Subclasses

CodeError, NoPermission

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status: nil, code: 0, headers: {}, route: nil, body: nil, response: nil) ⇒ HTTPError

Returns a new instance of HTTPError.



20
21
22
23
24
25
26
27
28
# File 'lib/onyxcord/core/errors.rb', line 20

def initialize(message = nil, status: nil, code: 0, headers: {}, route: nil, body: nil, response: nil)
  super(message)
  @status = status
  @code = code || 0
  @headers = headers
  @route = route
  @body = body
  @response = response
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



18
19
20
# File 'lib/onyxcord/core/errors.rb', line 18

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



18
19
20
# File 'lib/onyxcord/core/errors.rb', line 18

def code
  @code
end

#headersObject (readonly)

Returns the value of attribute headers.



18
19
20
# File 'lib/onyxcord/core/errors.rb', line 18

def headers
  @headers
end

#responseObject (readonly)

Returns the value of attribute response.



18
19
20
# File 'lib/onyxcord/core/errors.rb', line 18

def response
  @response
end

#routeObject (readonly)

Returns the value of attribute route.



18
19
20
# File 'lib/onyxcord/core/errors.rb', line 18

def route
  @route
end

#statusObject (readonly)

Returns the value of attribute status.



18
19
20
# File 'lib/onyxcord/core/errors.rb', line 18

def status
  @status
end