Exception: Mongoid::Errors::TransactionError

Inherits:
MongoidError
  • Object
show all
Defined in:
lib/mongoid/errors/transaction_error.rb

Overview

This error is raised when a transaction failed because of an unexpected error.

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Attribute Summary

Attributes inherited from MongoidError

#problem, #resolution, #summary

Instance Method Summary collapse

Methods inherited from MongoidError

#compose_message

Constructor Details

#initialize(error) ⇒ TransactionError

Creates the exception.

Parameters:

  • error (StandardError)

    Error that caused the transaction failure.



15
16
17
18
19
20
21
22
# File 'lib/mongoid/errors/transaction_error.rb', line 15

def initialize(error)
  super(
    compose_message(
      'transaction_error',
      { error: "#{error.class}: #{error.message}" }
    )
  )
end