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

Normalize node paths in errors (for compiler#229) #92

Merged
merged 5 commits into from
Mar 21, 2024

Conversation

Mingun
Copy link
Contributor

@Mingun Mingun commented Dec 5, 2020

After this change all paths in errors will point to existing nodes in KSY file and node, where error is originated

This PR should be merged together with kaitai-io/kaitai_struct_compiler#229 where actual fix done

@Mingun Mingun force-pushed the normalize-error-paths branch from e61596e to f162c10 Compare December 21, 2020 09:28
@Mingun Mingun force-pushed the normalize-error-paths branch from f162c10 to 1191594 Compare May 13, 2021 17:18
@Mingun Mingun force-pushed the normalize-error-paths branch from 1191594 to 1a8ba6c Compare April 10, 2023 18:24
@Mingun Mingun force-pushed the normalize-error-paths branch from 1a8ba6c to c6ec3b1 Compare March 8, 2024 14:34
@Mingun Mingun changed the title Normalize node paths in errors Normalize node paths in errors (for compiler#229) Mar 9, 2024
Mingun added 4 commits March 21, 2024 19:41
This change requires corresponding change in kaitai_struct_compiler repository
This change requires corresponding change in kaitai_struct_compiler repository
TypeValidator.validateSwitchType uses path with "type" therefore this is just behavior unification

This change requires corresponding change in kaitai_struct_compiler repository
… type/enum" errors

This change requires corresponding change in kaitai_struct_compiler repository
@Mingun Mingun force-pushed the normalize-error-paths branch from c6ec3b1 to 9c24d1c Compare March 21, 2024 14:43
@GreyCat
Copy link
Member

GreyCat commented Mar 21, 2024

Looks good to me, I think this gets us into much better territory in terms of error reporting.

@GreyCat GreyCat merged commit 1d6dcc6 into kaitai-io:master Mar 21, 2024
@Mingun Mingun deleted the normalize-error-paths branch March 21, 2024 18:02
Mingun added a commit to Mingun/kaitai_struct_tests that referenced this pull request Mar 22, 2024
…tai-io#92

Fixes the test
```
[info] - type_unknown_many *** FAILED ***
[info]   type_unknown_many.ksy: /seq/0/type:
[info]   	error: unable to find type 'some_unknown_name', searching from type_unknown_many
[info]
[info]   type_unknown_many.ksy: /seq/1/type:
[info]   	error: unable to find type 'also_unknown_name', searching from type_unknown_many
[info]
[info]   type_unknown_many.ksy: /seq/2/enum:
[info]   	error: unable to find enum 'unknown_enum', searching from type_unknown_many
[info]    did not equal type_unknown_many.ksy: /seq/0:
[info]   	error: unable to find type 'some_unknown_name', searching from type_unknown_many
[info]
[info]   type_unknown_many.ksy: /seq/1:
[info]   	error: unable to find type 'also_unknown_name', searching from type_unknown_many
[info]
[info]   type_unknown_many.ksy: /seq/2:
[info]   	error: unable to find enum 'unknown_enum', searching from type_unknown_many (SimpleMatchers.scala:34)
```
GreyCat pushed a commit that referenced this pull request Mar 22, 2024
Fixes the test
```
[info] - type_unknown_many *** FAILED ***
[info]   type_unknown_many.ksy: /seq/0/type:
[info]   	error: unable to find type 'some_unknown_name', searching from type_unknown_many
[info]
[info]   type_unknown_many.ksy: /seq/1/type:
[info]   	error: unable to find type 'also_unknown_name', searching from type_unknown_many
[info]
[info]   type_unknown_many.ksy: /seq/2/enum:
[info]   	error: unable to find enum 'unknown_enum', searching from type_unknown_many
[info]    did not equal type_unknown_many.ksy: /seq/0:
[info]   	error: unable to find type 'some_unknown_name', searching from type_unknown_many
[info]
[info]   type_unknown_many.ksy: /seq/1:
[info]   	error: unable to find type 'also_unknown_name', searching from type_unknown_many
[info]
[info]   type_unknown_many.ksy: /seq/2:
[info]   	error: unable to find enum 'unknown_enum', searching from type_unknown_many (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.

2 participants