Exception: DeltaCloud::HTTPError::ClientError
- Inherits:
-
StandardError
- Object
- StandardError
- DeltaCloud::HTTPError::ClientError
- Defined in:
- lib/errors.rb
Direct Known Subclasses
BadRequest, ExpectationFailed, Forbidden, Gone, MethodNotAllowed, NotAcceptable, NotFound, RequestTimeout, ServerError, UknownError, Unauthorized, UnsupportedMediaType
Instance Attribute Summary collapse
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Instance Method Summary collapse
-
#initialize(code, message, opts = {}, backtrace = nil) ⇒ ClientError
constructor
A new instance of ClientError.
Constructor Details
#initialize(code, message, opts = {}, backtrace = nil) ⇒ ClientError
Returns a new instance of ClientError.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/errors.rb', line 23 def initialize(code, , opts={}, backtrace=nil) @params, @driver, @provider = opts[:params], opts[:driver], opts[:provider] if code.to_s =~ /^5(\d{2})/ += "\nParameters: #{@params.inspect}\n" += "Driver: #{@driver}@#{@provider}" end super("#{code}\n\n#{self.class.superclass}: #{message}\n\n") # If server provided us the backtrace, then replace client backtrace # with the server one. set_backtrace(backtrace) unless backtrace.nil? end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
21 22 23 |
# File 'lib/errors.rb', line 21 def driver @driver end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
21 22 23 |
# File 'lib/errors.rb', line 21 def params @params end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
21 22 23 |
# File 'lib/errors.rb', line 21 def provider @provider end |