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

Generate meaningful exception message on checkVersion() failure #4522

Merged
merged 1 commit into from
Feb 7, 2024
Merged

Generate meaningful exception message on checkVersion() failure #4522

merged 1 commit into from
Feb 7, 2024

Conversation

raffaellod
Copy link
Contributor

Currently, loading a parser from an incompatible version results in a message like:

Could not deserialize ATN with version (expected 4).

(see e.g. #4041 )

Change the exception message generation to use ord(version), so it shows e.g. the string 3 instead of the character with ordinal 3, which is non-printable and the cause for the above cryptic message.

Currently, loading a parser from an incompatible version results in a message
like:

  Could not deserialize ATN with version  (expected 4).

(see e.g. #4041 )

Change the exception message generation to use ord(version), so it shows e.g.
the string 3 instead of the character with ordinal 3, which is non-printable
and the cause for the above cryptic message.

Signed-off-by: Raffaello D. Di Napoli <rafdev@dinapo.li>
@ericvergnaud ericvergnaud merged commit d0ddb32 into antlr:dev Feb 7, 2024
42 checks passed
@ericvergnaud
Copy link
Contributor

Thanks for this!

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