kaitai-io / kaitai_struct

Kaitai Struct: declarative language to generate binary data parsers in C++ / C# / Go / Java / JavaScript / Lua / Nim / Perl / PHP / Python / Ruby
https://kaitai.io
4.04k stars 199 forks source link

Sometimes errors does not have path #1131

Open Mingun opened 2 months ago

Mingun commented 2 months ago

This KSY

meta:
  id: test_type
instances:
  me:
    value: _on

reports the error (note, that this is full text):

java.util.NoSuchElementException: None.get

Compare with that KSY:

meta:
  id: test_type
instances:
  me:
    type:
      switch-on: 1
      cases:
        _on: u1

Error is:

test_type: /instances/me/type/cases/Name(identifier(_on)):
    error: None.get

Note, that error with missing path generated in many other cases (can't remember all the places, I started tracking them after I ran into the latest example).