Exception: Couchbase::Error::InvalidArgument

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/couchbase/errors.rb,
/code/couchbase-ruby-client/lib/couchbase/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#causeCouchbaseError? (readonly)

Returns original error that caused this one.

Returns:



59
60
61
# File 'lib/couchbase/errors.rb', line 59

def cause
  @cause
end

#contextHash?

Returns attributes associated with the error.

Returns:

  • (Hash, nil)

    attributes associated with the error



56
57
58
# File 'lib/couchbase/errors.rb', line 56

def context
  @context
end

Instance Method Details

#to_sObject



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