Exception: CloudFS::RestAdapter::Errors::ClientError
Overview
Base class of Client side errors - ConnectionFailed, TimeoutError
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Fixnum
readonly
Http status.
-
#request ⇒ Hash
readonly
{ :uri => String, :method => String, :params => String }.
-
#response ⇒ { :content => "HTTPClient Error", :content_type => "application/text", :code => -1 }
readonly
Is not informative, see backtrace for more info.
Instance Method Summary collapse
-
#backtrace ⇒ String
Backtrace of original exception.
-
#initialize(error, request = {}) ⇒ ClientError
constructor
A new instance of ClientError.
Constructor Details
#initialize(error, request = {}) ⇒ ClientError
Returns a new instance of ClientError.
163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/cloudfs/client/error.rb', line 163
def initialize(error, request={})
if error.respond_to?(:backtrace)
super(error.message)
@original = error
@code = -1
@request = request
# nothing informative to provide here
@response = {:content => 'HTTPClient Error',
:content_type => 'application/text', :code => -1}
else
super(error.to_s)
end
end
|
Instance Attribute Details
#code ⇒ Fixnum (readonly)
Returns http status.
152 153 154 |
# File 'lib/cloudfs/client/error.rb', line 152
def code
@code
end
|
#request ⇒ Hash (readonly)
{ :uri => String, :method => String, :params => String }
159 160 161 |
# File 'lib/cloudfs/client/error.rb', line 159
def request
@request
end
|
#response ⇒ { :content => "HTTPClient Error", :content_type => "application/text", :code => -1 } (readonly)
Is not informative, see backtrace for more info
156 157 158 |
# File 'lib/cloudfs/client/error.rb', line 156
def response
@response
end
|
Instance Method Details
#backtrace ⇒ String
Returns backtrace of original exception.
178 179 180 |
# File 'lib/cloudfs/client/error.rb', line 178
def backtrace
@original.backtrace if @original && @original.respond_to?(:backtrace)
end
|