Exception: JsonApiClient::Errors::ServerError

Inherits:
ApiError
  • Object
show all
Defined in:
lib/json_api_client/errors.rb

Instance Attribute Summary

Attributes inherited from ApiError

#env

Instance Method Summary collapse

Constructor Details

#initialize(env, msg = nil) ⇒ ServerError

Returns a new instance of ServerError.


51
52
53
54
55
56
57
58
59
# File 'lib/json_api_client/errors.rb', line 51

def initialize(env, msg = nil)
  msg ||= begin
    status = env.status
    message = ::Rack::Utils::HTTP_STATUS_CODES[status]
    "#{status} #{message}"
  end

  super env, msg
end