Class: Mongo::Error::InvalidTransactionOperation
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Error
|
|
|
Instance Chain:
self,
Error
|
|
| Inherits: |
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 =
# File 'lib/mongo/error/invalid_transaction_operation.rb', line 38
The error message for when a transaction read operation uses a non-primary read preference.
'read preference in a transaction must be primary' -
NO_TRANSACTION_STARTED =
# File 'lib/mongo/error/invalid_transaction_operation.rb', line 27
The error message for when a user attempts to commit or abort a transaction when none is in progress.
'no transaction started' -
TRANSACTION_ALREADY_IN_PROGRESS =
# File 'lib/mongo/error/invalid_transaction_operation.rb', line 33
The error message for when a user attempts to start a transaction when one is already in progress.
'transaction already in progress' -
UNACKNOWLEDGED_WRITE_CONCERN =
# File 'lib/mongo/error/invalid_transaction_operation.rb', line 43
The error message for when a transaction is started with an unacknowledged write concern.
'transactions do not support unacknowledged write concern'
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.
Constructor Details
.new(msg) ⇒ InvalidTransactionOperation
Instantiate the new exception.
# File 'lib/mongo/error/invalid_transaction_operation.rb', line 51
def initialize(msg) super 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 77
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 63
def self.cannot_call_twice_msg(op) "cannot call #{op} twice" end