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

Please improve exceptions thrown by the parser #165

Open
burdoto opened this issue Mar 27, 2024 · 3 comments · May be fixed by #166
Open

Please improve exceptions thrown by the parser #165

burdoto opened this issue Mar 27, 2024 · 3 comments · May be fixed by #166

Comments

@burdoto
Copy link

burdoto commented Mar 27, 2024

Caused by: com.electronwill.nightconfig.core.io.ParsingException: Invalid bare key: ]
         at com.electronwill.nightconfig.toml.TableParser.parseKey(TableParser.java:175) ~[toml-3.6.4.jar%2393!/:?]
         at com.electronwill.nightconfig.toml.TableParser.parseDottedKey(TableParser.java:145) ~[toml-3.6.4.jar%2393!/:?]
         at com.electronwill.nightconfig.toml.TableParser.parseNormal(TableParser.java:55) ~[toml-3.6.4.jar%2393!/:?]
         at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:44) ~[toml-3.6.4.jar%2393!/:?]
         at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:37) ~[toml-3.6.4.jar%2393!/:?]
         at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:113) ~[core-3.6.4.jar%2392!/:?]
         at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:219) ~[core-3.6.4.jar%2392!/:?]
         at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:202) ~[core-3.6.4.jar%2392!/:?]
         at com.electronwill.nightconfig.core.file.WriteSyncFileConfig.load(WriteSyncFileConfig.java:73) ~[core-3.6.4.jar%2392!/:?]
         at com.electronwill.nightconfig.core.file.AutosaveCommentedFileConfig.load(AutosaveCommentedFileConfig.java:85) ~[core-3.6.4.jar%2392!/:?]
         at net.minecraftforge.fml.config.ConfigFileTypeHandler.lambda$reader$1(ConfigFileTypeHandler.java:43) ~[fmlcore-1.20.1-47.2.20.jar%23458!/:?]
         ... 10 more

Yes I know this is inside Minecraft Forge. The issue lies within the parser; a parser exception couldn't be less explanative than this.

  • I dont know what file this is from (ok i blame forge for this)
  • I dont know what line this is from
  • Let alone the column of the input
  • I ONLY know there is a bad ] somewhere

Figuring out where exactly this issue came from had cost me an entire hour. For a parser exception. Please address this; this is just frustrating as hell.

@burdoto
Copy link
Author

burdoto commented Mar 27, 2024

please note that i am well aware that this says "caused by" because this exception is wrapped in another one. i reported this after finding this issue when SUDDENLY forge decided to rethrow the exception.
my point still stands. a parser exception should not be like this.

@TheElectronWill
Copy link
Owner

I understand the frustration, it could certainly be better, yes. I think there's already an issue for that (#105).

However, please understand that my time is unfortunately limited, like everyone else. Tracking precise line and column numbers isn't completely trivial.

@burdoto
Copy link
Author

burdoto commented Mar 28, 2024

I totally understand and didn't mean to push you into fixing it immediately. As noted, I think that Forge is the one to actually blame most here (how surprising /s), because its only in certain scenarios wrapping the parser exception with a more detailed exception that contains at least information about the source mod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants