Exception: Zonesync::ChecksumMismatchError

Inherits:
StandardError
  • Object
show all
Extended by:
T::Sig
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



87
88
89
90
91
92
93
# File 'lib/zonesync/errors.rb', line 87

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



96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/zonesync/errors.rb', line 96

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"