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

Minor improvements to error messages #1501

Closed
JustinAzoff opened this issue Aug 18, 2023 · 1 comment · Fixed by #1718
Closed

Minor improvements to error messages #1501

JustinAzoff opened this issue Aug 18, 2023 · 1 comment · Fixed by #1718
Assignees
Labels
Codegen Good first issue Good for newcomers

Comments

@JustinAzoff
Copy link

When trying to reproduce an analyzer issue I often see messages like:

[fatal error] terminating with uncaught exception of type spicy::rt::ParseError: &size amount not consumed (./analyzer/asn1.spicy:123:16)
[fatal error] terminating with uncaught exception of type hilti::rt::RuntimeError: more than max of 8 bytes for conversion to integer (./analyzer/asn1.spicy:82:12)

It would be nice of those messages were more like

[fatal error] terminating with uncaught exception of type spicy::rt::ParseError: &size amount not consumed. 
 Expected 100, got 85 (./analyzer/asn1.spicy:123:16)
[fatal error] terminating with uncaught exception of type hilti::rt::RuntimeError: more than max of 8 bytes for conversion to integer: 16 (./analyzer/asn1.spicy:82:12)
@bbannier bbannier added Good first issue Good for newcomers Codegen labels Aug 20, 2023
@awelzel
Copy link
Contributor

awelzel commented Aug 21, 2023

Piggy-backing, a few days ago I was tempted to open a similar issue for switch (expr) not including information for the no matching case error:

"failure_reason":"no matching case in switch statement (<...>/QUIC.spicy:174:3-183:5)"

Mostly convenience during development, but depending on the switch and involved types, potentially interesting to pivot on parser errors in live deployments, too.

@rsmmr rsmmr self-assigned this Apr 16, 2024
rsmmr added a commit that referenced this issue Apr 16, 2024
@rsmmr rsmmr closed this as completed in 92a3095 Apr 18, 2024
rsmmr added a commit that referenced this issue Apr 18, 2024
* origin/topic/robin/gh-1501-error-msgs:
  Improve some error messages for runtime parse errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codegen Good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants