Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve text of some errors #311

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Mingun
Copy link
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

Mingun added 3 commits October 5, 2024 20:45
…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)
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