Skip to content

Surprising error message for missing quotes #27

@henrikje

Description

@henrikje

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions