Exception: CloudFS::RestAdapter::Errors::ServiceError
- Defined in:
- lib/cloudfs/client/error.rb
Overview
Base class of all errors returned by cloudfs service
Direct Known Subclasses
APICallLimitReached, APIError, EndpointError, FileError, FileSystemError, FolderError, GeneralPanicError, ShareError
Instance Attribute Summary collapse
-
#code ⇒ Fixnum
readonly
Http status.
-
#request ⇒ Hash
readonly
Request context.
-
#response ⇒ Hash
readonly
Response context.
Instance Method Summary collapse
-
#backtrace ⇒ String
Backtrace of original exception.
-
#initialize(message, original = nil) ⇒ ServiceError
constructor
A new instance of ServiceError.
Constructor Details
#initialize(message, original = nil) ⇒ ServiceError
Returns a new instance of ServiceError.
218 219 220 221 |
# File 'lib/cloudfs/client/error.rb', line 218
def initialize(message, original=nil)
super(message)
@original = original
end
|
Instance Attribute Details
#code ⇒ Fixnum (readonly)
Returns http status.
245 246 247 248 249 250 251 |
# File 'lib/cloudfs/client/error.rb', line 245
def code
if @original.respond_to?(:code)
@original.code
else
-1
end
end
|
#request ⇒ Hash (readonly)
Returns request context.
225 226 227 228 229 230 231 |
# File 'lib/cloudfs/client/error.rb', line 225
def request
if @original.respond_to?(:request)
@original.request
else
{}
end
end
|
#response ⇒ Hash (readonly)
Returns response context.
235 236 237 238 239 240 241 |
# File 'lib/cloudfs/client/error.rb', line 235
def response
if @original.respond_to?(:response)
@original.response
else
{}
end
end
|
Instance Method Details
#backtrace ⇒ String
Returns backtrace of original exception.
254 255 256 |
# File 'lib/cloudfs/client/error.rb', line 254
def backtrace
@original.backtrace if @original && @original.respond_to?(:backtrace)
end
|