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

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

Overview

Unused since Kaitai Struct Compiler v0.9+ - compatibility with older versions.

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.



85
86
87
88
89
# File 'lib/kaitai/struct/struct.rb', line 85

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