Exception: Shift::Api::Core::Errors::UnexpectedStatus

Inherits:
ServerError show all
Defined in:
lib/shift/api/core/errors.rb

Instance Attribute Summary collapse

Attributes inherited from ApiError

#env, #original_exception

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ServerError

#backtrace

Constructor Details

#initialize(code, uri) ⇒ UnexpectedStatus

Returns a new instance of UnexpectedStatus.



89
90
91
92
# File 'lib/shift/api/core/errors.rb', line 89

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



88
89
90
# File 'lib/shift/api/core/errors.rb', line 88

def code
  @code
end

#uriObject (readonly)

Returns the value of attribute uri.



88
89
90
# File 'lib/shift/api/core/errors.rb', line 88

def uri
  @uri
end

Class Method Details

.from_jsonapi_client(ex) ⇒ Object



98
99
100
# File 'lib/shift/api/core/errors.rb', line 98

def self.from_jsonapi_client(ex)
  new(ex.code, ex.uri)
end

Instance Method Details

#messageObject



94
95
96
# File 'lib/shift/api/core/errors.rb', line 94

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