Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

improve serde error messages #14

Merged
merged 1 commit into from
Nov 25, 2019
Merged

improve serde error messages #14

merged 1 commit into from
Nov 25, 2019

Conversation

wez
Copy link
Contributor

@wez wez commented Nov 25, 2019

In this scenario:

struct Foo {
  foo: bool
}

deserializing this:

foo: "bar"

would yield an error with no context. This commit includes the
field name in the error message for this and a couple of other
similar looking cases.

It would be great if the filename and line number of the originating
token were available for these error messages; the use case I'm
considering would benefit from using the include feature of hocon
and I can see it being frustrating to track down errors without that.

In this scenario:

```
struct Foo {
  foo: bool
}
```

deserializing this:

```
foo: "bar"
```

would yield an error with no context.  This commit includes the
field name in the error message for this and a couple of other
similar looking cases.
@mockersf
Copy link
Owner

👍

@mockersf mockersf merged commit 21c856d into mockersf:master Nov 25, 2019
@mockersf
Copy link
Owner

It would be great if the filename and line number of the originating
token were available for these error messages

I'll give a go at filename, I think I have an idea on how to do it. line number would be... harder

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

Successfully merging this pull request may close these issues.

2 participants