Module: Mongo::Error::Labelable
Relationships & Source Files |
Extension / Inclusion / Inheritance Descendants |
Included In:
::Mongo::Auth::Unauthorized ,
::Mongo::Error ,
BadLoadBalancerTarget ,
BulkWriteError ,
ClientClosed ,
ClosedStream ,
ConnectionPerished ,
ConnectionUnavailable ,
CryptError ,
ExtraFileChunk ,
FailedStringPrepValidation ,
FileNotFound ,
HandshakeError ,
InsufficientIterationCount ,
InternalDriverError ,
InvalidAddress ,
InvalidApplicationName ,
InvalidBulkOperation ,
InvalidBulkOperationType ,
InvalidCollectionName ,
InvalidConfigOption ,
InvalidCursorOperation ,
InvalidDatabaseName ,
InvalidDocument ,
InvalidFile ,
InvalidFileRevision ,
InvalidMaxConnecting ,
InvalidMinPoolSize ,
InvalidNonce ,
InvalidReadConcern ,
InvalidReadOption ,
InvalidReplacementDocument ,
InvalidServerPreference ,
InvalidSession ,
InvalidSignature ,
InvalidTXTRecord ,
InvalidTransactionOperation ,
InvalidURI ,
InvalidUpdateDocument ,
InvalidWriteConcern ,
KmsError ,
LintError ,
MaxBSONSize ,
MaxMessageSize ,
MismatchedDomain ,
MissingConnection ,
MissingFileChunk ,
MissingPassword ,
MissingResumeToken ,
MissingScramServerSignature ,
MissingServiceId ,
MongocryptdSpawnError ,
MultiIndexDrop ,
NeedPrimaryServer ,
NoSRVRecords ,
NoServerAvailable ,
NoServiceConnectionAvailable ,
OperationFailure ,
PoolClearedError ,
PoolClosedError ,
PoolError ,
PoolPausedError ,
ServerApiConflict ,
ServerApiNotSupported ,
ServerCertificateRevoked ,
ServerNotUsable ,
ServerTimeoutError ,
SessionEnded ,
SessionNotMaterialized ,
SessionsNotSupported ,
SnapshotSessionInvalidServerVersion ,
SnapshotSessionTransactionProhibited ,
SocketError ,
SocketTimeoutError ,
TimeoutError ,
TransactionsNotSupported ,
UnchangeableCollectionOption ,
UnexpectedChunkLength ,
UnexpectedResponse ,
UnknownPayloadType ,
UnmetDependency ,
UnsupportedArrayFilters ,
UnsupportedCollation ,
UnsupportedFeatures ,
UnsupportedMessageType ,
UnsupportedOption ,
::Mongo::Server::AppMetadata::Environment::MissingVariable ,
::Mongo::Server::AppMetadata::Environment::TooManyEnvironments ,
::Mongo::Server::AppMetadata::Environment::TypeMismatch ,
::Mongo::Server::AppMetadata::Environment::ValueTooLong
|
Defined in: |
lib/mongo/error/labelable.rb |
Overview
Note:
Although methods of this module are part of the public API, the fact that these methods are defined on this module and not on the classes which include this module is not part of the public API.
A module encapsulating functionality to manage labels added to errors.
Instance Method Summary
Instance Method Details
#add_label(label)
This method is for internal use only.
Adds the specified label to the error instance, if the label is not already in the set of labels.
[ GitHub ]
# File 'lib/mongo/error/labelable.rb', line 66
def add_label(label)
@labels ||= []
@labels << label unless label?(label)
end
#label?(label) ⇒ true
, false
Does the error have the given label?
[ GitHub ]
# File 'lib/mongo/error/labelable.rb', line 40
def label?(label)
@labels && @labels.include?(label)
end
#labels ⇒ Array
Gets the set of labels associated with the error.
[ GitHub ]
# File 'lib/mongo/error/labelable.rb', line 52
def labels
if @labels
@labels.dup
else
[]
end
end