Exception: Mongo::Error::InvalidTransactionOperation
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::Mongo::Error ,
StandardError
|
|
Instance Chain:
|
|
Inherits: |
Mongo::Error
|
Defined in: | lib/mongo/error/invalid_transaction_operation.rb |
Overview
Exception raised if an invalid operation is attempted as part of a transaction.
Constant Summary
-
INVALID_READ_PREFERENCE =
The error message for when a transaction read operation uses a non-primary read preference.
'read preference in a transaction must be primary'.freeze
-
NO_TRANSACTION_STARTED =
The error message for when a user attempts to commit or abort a transaction when none is in progress.
'no transaction started'.freeze
-
TRANSACTION_ALREADY_IN_PROGRESS =
The error message for when a user attempts to start a transaction when one is already in progress.
'transaction already in progress'.freeze
-
UNACKNOWLEDGED_WRITE_CONCERN =
The error message for when a transaction is started with an unacknowledged write concern.
'transactions do not support unacknowledged write concern'.freeze
::Mongo::Error
- Inherited
BAD_VALUE, CODE, CURSOR_NOT_FOUND, ERR, ERRMSG, ERROR, TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_ERROR, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL, WRITE_CONCERN_ERROR, WRITE_CONCERN_ERRORS, WRITE_ERRORS
Class Method Summary
-
.cannot_call_after_msg(last_op, current_op)
Create an error message for incorrectly running a transaction operation that cannot be run after the previous one.
-
.cannot_call_twice_msg(op)
Create an error message for incorrectly running a transaction operation twice.
-
.new(msg) ⇒ InvalidTransactionOperation
constructor
Instantiate the new exception.
::Mongo::Error
- Inherited
Instance Attribute Summary
::Mongo::Error
- Inherited
#change_stream_resumable? | Can the change stream on which this error occurred be resumed, provided the operation that triggered this error was a getMore? |
#network_error? |
ChangeStreamResumable
- Included
#change_stream_resumable? | Can the change stream on which this error occurred be resumed, provided the operation that triggered this error was a getMore? |
WriteRetryable
- Included
Notable
- Included
#connection_global_id | Returns global id of the connection on which the error occurred. |
#generation | Returns connection pool generation for the connection on which the error occurred. |
#service_id | Returns service id for the connection on which the error occurred. |
Instance Method Summary
::Mongo::Error
- Inherited
#write_concern_error_label? | Does the write concern error have the given label? |
#write_concern_error_labels | The set of error labels associated with the write concern error. |
Labelable
- Included
#add_label | Adds the specified label to the error instance, if the label is not already in the set of labels. |
#label? | Does the error have the given label? |
#labels | Gets the set of labels associated with the error. |
Notable
- Included
#add_note, | |
#add_notes | Allows multiple notes to be added in a single call, for convenience. |
#notes | Returns an array of strings with additional information about the exception. |
#to_s, #notes_tail |
Constructor Details
.new(msg) ⇒ InvalidTransactionOperation
Instantiate the new exception.
# File 'lib/mongo/error/invalid_transaction_operation.rb', line 54
def initialize(msg) super(msg) end
Class Method Details
.cannot_call_after_msg(last_op, current_op)
Create an error message for incorrectly running a transaction operation that cannot be run after the previous one.
# File 'lib/mongo/error/invalid_transaction_operation.rb', line 80
def self.cannot_call_after_msg(last_op, current_op) "Cannot call #{current_op} after calling #{last_op}" end
.cannot_call_twice_msg(op)
Create an error message for incorrectly running a transaction operation twice.
# File 'lib/mongo/error/invalid_transaction_operation.rb', line 66
def self.cannot_call_twice_msg(op) "cannot call #{op} twice" end