Module: Mongo::Operation::ExecutableTransactionLabel Private

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Note:

This module should be included after ExecutableNoValidate, if both are included in a class.

Shared behavior of applying transaction error label to execution result.

Instance Method Summary collapse

Instance Method Details

#execute(server) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



26
27
28
29
30
31
32
33
# File 'lib/mongo/operation/shared/executable_transaction_label.rb', line 26

def execute(server)
  super
rescue Mongo::Error::SocketError => e
  if session && session.in_transaction?
    e.send(:add_label, Mongo::Error::TRANSIENT_TRANSACTION_ERROR_LABEL)
  end
  raise e
end