Skip to content

Improve text of some errors#311

Open
Mingun wants to merge 3 commits intokaitai-io:masterfrom
Mingun:human-readable
Open

Improve text of some errors#311
Mingun wants to merge 3 commits intokaitai-io:masterfrom
Mingun:human-readable

Conversation

@Mingun
Copy link
Copy Markdown
Contributor

@Mingun Mingun commented Oct 5, 2024

This PR improves text of errors and partially implements this TODO:

// TODO: get rid of MethodNotFoundError in favor of MethodNotFoundErrorWithArg, rename it back

In all situations where MethodNotFoundErrorWithArg could be thrown it is thrown. Also I added new MethodTypeArg for kaitai stream type.

PR for updating tests: kaitai-io/kaitai_struct_tests#129

…ossible

Tests that need to be updated:

[info] - expr_unknown_method1 *** FAILED ***
[info]   [expr_unknown_method1.ksy: /instances/foo/value:
[info]          error: don't know how to call method 'frobnicate' of object type 'byte array'
[info]   ]
[info]     did not equal
[info]   [expr_unknown_method1.ksy: /instances/foo/value:
[info]          error: don't know how to call method 'frobnicate' of object type 'CalcBytesType'
[info]   ] (SimpleMatchers.scala:34)
[info] - expr_unknown_method2 *** FAILED ***
[info]   [expr_unknown_method2.ksy: /instances/foo/value:
[info]          error: don't know how to call method 'frobnicate' of object type 'byte array'
[info]   ]
[info]     did not equal
[info]   [expr_unknown_method2.ksy: /instances/foo/value:
[info]          error: don't know how to call method 'frobnicate' of object type 'CalcBytesType'
[info]   ] (SimpleMatchers.scala:34)
[info] - io_on_bytes *** FAILED ***
[info]   [io_on_bytes.ksy: /instances/one_in_foo/io:
[info]          error: don't know how to call method '_io' of object type 'byte array'
[info]   ]
[info]     did not equal
[info]   [io_on_bytes.ksy: /instances/one_in_foo/io:
[info]          error: don't know how to call method '_io' of object type 'BytesLimitType(IntNum(100),None,false,None,None)'
[info]   ] (SimpleMatchers.scala:34)
Mingun added a commit to Mingun/kaitai_struct_tests that referenced this pull request Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant