Exception: Couchbase::Error::CouchbaseError
- Inherits:
-
StandardError
- Object
- StandardError
- Couchbase::Error::CouchbaseError
- Defined in:
- lib/couchbase/errors.rb,
/code/couchbase-ruby-client/lib/couchbase/errors.rb
Direct Known Subclasses
AuthenticationFailure, BackendError, BucketExists, BucketNotFlushable, BucketNotFound, CasMismatch, ClusterClosed, CollectionExists, CollectionNotFound, CompilationFailure, ConsistencyMismatch, DatasetExists, DatasetNotFound, DataverseExists, DataverseNotFound, DecodingFailure, DeltaInvalid, DesignDocumentNotFound, DocumentExists, DocumentIrretrievable, DocumentLocked, DocumentNotFound, DocumentNotJson, DocumentNotLocked, DurabilityAmbiguous, DurabilityImpossible, DurabilityLevelNotAvailable, DurableWriteInProgress, DurableWriteReCommitInProgress, EncodingFailure, FeatureNotAvailable, GroupNotFound, IndexExists, IndexFailure, IndexNotFound, IndexNotReady, InternalServerFailure, JobQueueFull, LinkExists, LinkNotFound, MutationTokenOutdated, NoEnvironment, NumberTooBig, ParsingFailure, PathExists, PathInvalid, PathMismatch, PathNotFound, PathTooBig, PathTooDeep, PermissionDenied, PlanningFailure, PreparedStatementFailure, RequestCanceled, ScopeExists, ScopeNotFound, ServiceNotAvailable, TemporaryFailure, Timeout, UnsupportedOperation, UserExists, UserNotFound, ValueInvalid, ValueTooDeep, ValueTooLarge, ViewNotFound, XattrCannotModifyVirtualAttribute, XattrInvalidKeyCombo, XattrUnknownMacro, XattrUnknownVirtualAttribute
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) ⇒ CouchbaseError
constructor
A new instance of CouchbaseError.
- #to_s ⇒ Object
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
#cause ⇒ CouchbaseError? (readonly)
Returns original error that caused this one.
27 28 29 |
# File 'lib/couchbase/errors.rb', line 27 def cause @cause end |
#context ⇒ Hash?
Returns attributes associated with the error.
24 25 26 |
# File 'lib/couchbase/errors.rb', line 24 def context @context end |
Instance Method Details
#to_s ⇒ Object
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 |