Exception: Couchbase::Error::InvalidArgument
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Couchbase::Error::InvalidArgument
- Defined in:
- lib/couchbase/errors.rb,
/code/couchbase-ruby-client/lib/couchbase/errors.rb
Instance Attribute Summary collapse
-
#cause ⇒ CouchbaseError?
readonly
Original error that caused this one.
-
#context ⇒ Hash?
Attributes associated with the error.
Instance Method Summary collapse
-
#initialize(msg = nil, context = nil, cause = nil) ⇒ InvalidArgument
constructor
A new instance of InvalidArgument.
- #to_s ⇒ Object
Constructor Details
#initialize(msg = nil, context = nil, cause = nil) ⇒ InvalidArgument
Returns a new instance of InvalidArgument.
61 62 63 64 65 |
# File 'lib/couchbase/errors.rb', line 61 def initialize(msg = nil, context = nil, cause = nil) @context = context @cause = cause super(msg) end |
Instance Attribute Details
#cause ⇒ CouchbaseError? (readonly)
Returns original error that caused this one.
59 60 61 |
# File 'lib/couchbase/errors.rb', line 59 def cause @cause end |
#context ⇒ Hash?
Returns attributes associated with the error.
56 57 58 |
# File 'lib/couchbase/errors.rb', line 56 def context @context end |
Instance Method Details
#to_s ⇒ Object
78 79 80 81 82 83 |
# File 'lib/couchbase/errors.rb', line 78 def to_s result = super result << ", context=#{JSON.generate(@context)}" if @context result << ", cause=#{@cause}" if @cause result end |