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

Surprising error message for missing quotes #27

Open
henrikje opened this issue Mar 8, 2023 · 0 comments
Open

Surprising error message for missing quotes #27

henrikje opened this issue Mar 8, 2023 · 0 comments

Comments

@henrikje
Copy link

henrikje commented Mar 8, 2023

When decoding a TOML file containing a value which is supposed to be quoted (e.g. key = "value") but the quotes are missing (key = value), the error message is a bit surprising.

Actual error message:

Exception in thread "main" ParseError(errorDescription=Expected EOF, but got 'k'., line=1, cause=null)
	at cc.ekblad.toml.parser.DocumentKt.parseTomlDocument(Document.kt:47)
	at cc.ekblad.toml.serialization.TomlDeserializerKt.from(TomlDeserializer.kt:17)
        ...

Expected error message: Something which suggests there is something wrong with the value.

Code to reproduce:

val mapper = tomlMapper {  }
val config: Map<String, String> = mapper.decode("key = value")
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

No branches or pull requests

1 participant