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 add output of element name when there is an error #81

Open
hlindberg opened this issue Aug 25, 2020 · 1 comment
Open

Please add output of element name when there is an error #81

hlindberg opened this issue Aug 25, 2020 · 1 comment

Comments

@hlindberg
Copy link
Contributor

When getting an error like this:

panic: reflect: call of reflect.Value.SetFloat on int32 Value [recovered]
	panic: reflect: call of reflect.Value.SetFloat on int32 Value

When calling vf.FromValue(v, target) it is time consuming to figure out where the problem is when there are multiple int32 values in the target structure.
Suggest adding the name of the type/member that it is failing on in the error message. There should probably be a general catch that amends all error messages.

@hlindberg
Copy link
Contributor Author

hlindberg commented Sep 8, 2020

There is a similar problem when the yaml file does not parse ok. For example:

henrik$ lookup mykey --explain
Error: yaml: line 2: found unexpected end of stream
&{0xc0000bc0c0} yaml: line 2: found unexpected end of stream

That error comes from one yaml data file among 50 or so...

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