Exception: AllPlayers::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/allplayers/error.rb,
lib/allplayers/error/decode_error.rb,
lib/allplayers/error/restclient_error.rb

Overview

Custom error class for rescuing from all AllPlayers errors

Direct Known Subclasses

ClientError, DecodeError

Defined Under Namespace

Classes: ClientError, DecodeError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ AllPlayers::Error

Initializes a new Error object

Parameters:

  • response (Hash)


10
11
12
13
# File 'lib/allplayers/error.rb', line 10

def initialize(response)
  @code = response.code
  @error = response.body
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/allplayers/error.rb', line 4

def code
  @code
end

#errorObject (readonly)

Returns the value of attribute error.



4
5
6
# File 'lib/allplayers/error.rb', line 4

def error
  @error
end