Exception: MLB::HTTPError

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

Direct Known Subclasses

ClientError, ServerError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response:) ⇒ HTTPError

Returns a new instance of HTTPError.



8
9
10
11
12
# File 'lib/mlb/errors/http_error.rb', line 8

def initialize(response:)
  super(response.message)
  @response = response
  @code = response.code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



6
7
8
# File 'lib/mlb/errors/http_error.rb', line 6

def code
  @code
end

#responseObject (readonly)

Returns the value of attribute response.



6
7
8
# File 'lib/mlb/errors/http_error.rb', line 6

def response
  @response
end