Exception: SimpleSpotify::Error::DefaultError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/simplespotify/errors.rb

Direct Known Subclasses

API, NotFound, RateLimited, Unauthorized

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, body, request) ⇒ DefaultError

Returns a new instance of DefaultError.



26
27
28
29
30
31
# File 'lib/simplespotify/errors.rb', line 26

def initialize code, body, request
  @code = code
  @body = body
  @request = request
  @message = body[:error][:message] unless body.nil?
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



25
26
27
# File 'lib/simplespotify/errors.rb', line 25

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



25
26
27
# File 'lib/simplespotify/errors.rb', line 25

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



25
26
27
# File 'lib/simplespotify/errors.rb', line 25

def message
  @message
end

#requestObject (readonly)

Returns the value of attribute request.



25
26
27
# File 'lib/simplespotify/errors.rb', line 25

def request
  @request
end