Exception: Couchbase::Error::CouchbaseError

Inherits:
StandardError
  • 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) ⇒ CouchbaseError

Returns a new instance of CouchbaseError.



29
30
31
32
33
# File 'lib/couchbase/errors.rb', line 29

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:



27
28
29
# File 'lib/couchbase/errors.rb', line 27

def cause
  @cause
end

#contextHash?

Returns attributes associated with the error.

Returns:

  • (Hash, nil)

    attributes associated with the error



24
25
26
# File 'lib/couchbase/errors.rb', line 24

def context
  @context
end

Instance Method Details

#to_sObject



46
47
48
49
50
51
# File 'lib/couchbase/errors.rb', line 46

def to_s
  result = super
  result << ", context=#{JSON.generate(@context)}" if @context
  result << ", cause=#{@cause}" if @cause
  result
end