Exception: JSONAPI::Consumer::Errors::UnexpectedStatus

Inherits:
ServerError show all
Defined in:
lib/jsonapi/consumer/errors.rb

Instance Attribute Summary collapse

Attributes inherited from ApiError

#env

Instance Method Summary collapse

Constructor Details

#initialize(code, uri) ⇒ UnexpectedStatus

Returns a new instance of UnexpectedStatus.



46
47
48
49
# File 'lib/jsonapi/consumer/errors.rb', line 46

def initialize(code, uri)
  @code = code
  @uri = uri
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



45
46
47
# File 'lib/jsonapi/consumer/errors.rb', line 45

def code
  @code
end

#uriObject (readonly)

Returns the value of attribute uri.



45
46
47
# File 'lib/jsonapi/consumer/errors.rb', line 45

def uri
  @uri
end

Instance Method Details

#messageObject



50
51
52
# File 'lib/jsonapi/consumer/errors.rb', line 50

def message
  "Unexpected response status: #{code} from: #{uri.to_s}"
end