Exception: Kaitai::Struct::Stream::UnexpectedDataError

Inherits:
Exception
  • Object
show all
Defined in:
lib/kaitai/struct/struct.rb

Overview

Exception class for an error that occurs when some fixed content was expected to appear, but actual data read was different.

Instance Method Summary collapse

Constructor Details

#initialize(actual, expected) ⇒ UnexpectedDataError

Returns a new instance of UnexpectedDataError.



83
84
85
86
87
# File 'lib/kaitai/struct/struct.rb', line 83

def initialize(actual, expected)
  super("Unexpected fixed contents: got #{Stream.format_hex(actual)}, was waiting for #{Stream.format_hex(expected)}")
  @actual = actual
  @expected = expected
end