Exception: Couchbase::Error::CouchbaseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/couchbase/errors.rb,
ext/rcb_exceptions.cxx

Direct Known Subclasses

AuthenticationFailure, BackendError, BucketClosed, BucketExists, BucketNotFlushable, BucketNotFound, CannotReviveLivingDocument, CasMismatch, ClusterClosed, CollectionExists, CollectionNotFound, CompilationFailure, ConsistencyMismatch, DatasetExists, DatasetNotFound, DataverseExists, DataverseNotFound, DecodingFailure, DeltaInvalid, DesignDocumentNotFound, DmlFailure, DocumentExists, DocumentIrretrievable, DocumentLocked, DocumentNotFound, DocumentNotJson, DocumentNotLocked, DurabilityAmbiguous, DurabilityImpossible, DurabilityLevelNotAvailable, DurableWriteInProgress, DurableWriteReCommitInProgress, EncodingFailure, EndOfStream, EventingFunctionCompilationFailure, EventingFunctionDeployed, EventingFunctionIdentialKeyspace, EventingFunctionNotBootstrapped, EventingFunctionNotDeployed, EventingFunctionNotFound, EventingFunctionPaused, FeatureNotAvailable, GroupNotFound, IndexExists, IndexFailure, IndexNotFound, IndexNotReady, InternalServerFailure, JobQueueFull, LinkExists, LinkNotFound, MutationTokenOutdated, NeedMoreData, NetworkRequestCanceled, NoEnvironment, NumberTooBig, OperationQueueClosed, OperationQueueFull, ParsingFailure, PathExists, PathInvalid, PathMismatch, PathNotFound, PathTooBig, PathTooDeep, PermissionDenied, PlanningFailure, PreparedStatementFailure, QuotaLimited, RateLimited, RequestAlreadyQueued, RequestCanceled, ScopeExists, ScopeNotFound, ServiceNotAvailable, TemporaryFailure, Timeout, UnsupportedOperation, UserExists, UserNotFound, ValueInvalid, ValueTooDeep, ValueTooLarge, ViewNotFound, XattrCannotModifyVirtualAttribute, XattrInvalidKeyCombo, XattrNoAccess, XattrUnknownMacro, XattrUnknownVirtualAttribute

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