Exception: StateOfTheNation::ConflictError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/state_of_the_nation/errors/conflict_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(record, conflicting_records) ⇒ ConflictError

Returns a new instance of ConflictError.



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/state_of_the_nation/errors/conflict_error.rb', line 3

def initialize(record, conflicting_records)
  super(<<-MSG.strip_heredoc)
    Attempted to commit record

      #{record.inspect}

    But encountered a conflict with timestamps on the following records

      #{conflicting_records.map { |record| "- #{record.inspect}" }.join("\n")}

  MSG
end