Exception: CloudFS::RestAdapter::Errors::ServerError

Inherits:
HttpError
  • Object
show all
Defined in:
lib/cloudfs/client/error.rb

Overview

Exception for errors returned by remote service

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, code, response = {}, request = {}) ⇒ ServerError

Returns a new instance of ServerError.

Parameters:

  • message (String)

    error message

  • code (Fixnum)

    error code

  • response (Hash) (defaults to: {})

    service response body

  • request (Hash) (defaults to: {})

    service request body



206
207
208
209
210
211
# File 'lib/cloudfs/client/error.rb', line 206

def initialize(message, code, response={}, request={})
  super(message)
  @code = code
  @response = response
  @request = request
end

Instance Attribute Details

#codeFixnum (readonly)

Returns http status.

Returns:

  • (Fixnum)

    http status



194
195
196
# File 'lib/cloudfs/client/error.rb', line 194

def code
  @code
end

#requestHash (readonly)

{ :uri => String, :method => String, :params => String }

Returns:

  • (Hash)

    request context



200
201
202
# File 'lib/cloudfs/client/error.rb', line 200

def request
  @request
end

#responseHash (readonly)

Returns response { :content => String, :content_type => String, :code => Fixnum }.

Returns:

  • (Hash)

    response { :content => String, :content_type => String, :code => Fixnum }



197
198
199
# File 'lib/cloudfs/client/error.rb', line 197

def response
  @response
end