Exception: E3DB::ConflictError
- Inherits:
-
StandardError
- Object
- StandardError
- E3DB::ConflictError
- Defined in:
- lib/e3db/client.rb
Overview
Exception thrown by E3DB::Client#update when a concurrent modification is detected. Upon catching this exception, a client should re-fetch the affected record and retry the update operation.
Instance Method Summary collapse
-
#initialize(record) ⇒ ConflictError
constructor
A new instance of ConflictError.
-
#record ⇒ Record
Return the record from the failing update attempt.
Constructor Details
#initialize(record) ⇒ ConflictError
Returns a new instance of ConflictError.
42 43 44 45 46 47 48 49 50 |
# File 'lib/e3db/client.rb', line 42 def initialize(record) if record.is_a? E3DB::Record super('Conflict updating record: ' + record..record_id) else super('Conflict updating record: ' + record) end @record = record end |
Instance Method Details
#record ⇒ Record
Return the record from the failing update attempt.
55 56 57 |
# File 'lib/e3db/client.rb', line 55 def record @record end |