Exception: Zonesync::ChecksumMismatchError

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

Instance Method Summary collapse

Constructor Details

#initialize(existing = nil, new = nil, expected_record: nil, actual_record: nil, missing_hash: nil) ⇒ ChecksumMismatchError

Returns a new instance of ChecksumMismatchError.



61
62
63
64
65
66
67
# File 'lib/zonesync/errors.rb', line 61

def initialize(existing = nil, new = nil, expected_record: nil, actual_record: nil, missing_hash: nil)
  @existing = existing
  @new = new
  @expected_record = expected_record
  @actual_record = actual_record
  @missing_hash = missing_hash
end

Instance Method Details

#messageObject



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/zonesync/errors.rb', line 69

def message
  # V2 manifest integrity violation
  if @missing_hash
    return generate_v2_message
  end

  # V1 checksum mismatch
  "    The zonesync_checksum TXT record does not match the current state of the DNS records. This probably means that someone else has changed them.\n      existing: \#{@existing}\n      new:      \#{@new}\n  MSG\nend\n"